ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
p
r
s
t
w
+
Functions
_
a
b
c
f
g
h
i
r
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
class.ilPDSelectedItemsBlockMembershipsObjectDatabaseRepository.php
Go to the documentation of this file.
1
<?php declare(strict_types=1);
2
20
final
class
ilPDSelectedItemsBlockMembershipsObjectDatabaseRepository
implements
ilPDSelectedItemsBlockMembershipsObjectRepository
21
{
22
private
const
VALID_OBJECT_TYPES
= [
23
'crs'
,
24
'grp'
,
25
];
26
28
private
$db
;
30
private
$recoveryFolderId
;
31
32
public
function
__construct
(
ilDBInterface
$db
,
int
$recoveryFolderId
)
33
{
34
$this->db =
$db
;
35
$this->recoveryFolderId =
$recoveryFolderId
;
36
}
37
41
public
function
getValidObjectTypes
() : array
42
{
43
return
self::VALID_OBJECT_TYPES;
44
}
45
49
public
function
getForUser
(
ilObjUser
$user, array $objTypes,
string
$actorLanguageCode) :
Generator
50
{
51
$objTypes = array_intersect($objTypes, self::VALID_OBJECT_TYPES);
52
if
($objTypes === []) {
53
return
;
54
}
55
56
$odObjTypes =
' AND '
. $this->db->in(
57
'od.type'
,
58
$objTypes,
59
false
,
60
'text'
61
);
62
63
$res
= $this->db->queryF(
64
"
65
SELECT DISTINCT
66
od.obj_id,
67
objr.ref_id,
68
(
69
CASE
70
WHEN (trans.title IS NOT NULL AND trans.title != '')
71
THEN trans.title
72
ELSE od.title
73
END
74
) title,
75
(
76
CASE
77
WHEN (trans.description IS NOT NULL AND trans.description != '')
78
THEN trans.description
79
ELSE od.description
80
END
81
) description,
82
od.type,
83
t.parent,
84
tp.lft parent_lft,
85
(
86
CASE
87
WHEN od.type = 'crs' THEN crs_settings.period_start
88
ELSE grp_settings.period_start
89
END
90
) period_start,
91
(
92
CASE
93
WHEN od.type = 'crs' THEN crs_settings.period_end
94
ELSE grp_settings.period_end
95
END
96
) period_end,
97
(
98
CASE
99
WHEN od.type = 'crs' THEN crs_settings.period_time_indication
100
ELSE grp_settings.period_time_indication
101
END
102
) period_has_time
103
FROM rbac_ua ua
104
INNER JOIN rbac_fa fa ON fa.rol_id = ua.rol_id AND fa.assign = %s
105
INNER JOIN object_reference objr ON objr.ref_id = fa.parent
106
INNER JOIN object_data od ON od.obj_id = objr.obj_id $odObjTypes
107
INNER JOIN tree t ON t.child = objr.ref_id AND t.tree = %s AND t.parent != %s
108
INNER JOIN tree tp ON tp.child = t.parent
109
LEFT JOIN grp_settings ON grp_settings.obj_id = od.obj_id
110
LEFT JOIN crs_settings ON crs_settings.obj_id = od.obj_id
111
LEFT JOIN object_translation trans ON trans.obj_id = od.obj_id AND trans.lang_code = %s
112
WHERE ua.usr_id = %s
113
"
,
114
[
'text'
,
'integer'
,
'integer'
,
'text'
,
'integer'
],
115
[
'y'
, 1, $this->recoveryFolderId, $actorLanguageCode, $user->
getId
()]
116
);
117
118
while
($row = $this->db->fetchAssoc(
$res
)) {
119
$periodStart = null;
120
if
(!is_null($row[
'period_start'
])) {
121
$periodStart =
new
DateTimeImmutable
($row[
'period_start'
],
new
DateTimeZone(
'UTC'
));
122
}
123
$periodEnd = null;
124
if
(!is_null($row[
'period_end'
])) {
125
$periodEnd =
new
DateTimeImmutable
($row[
'period_end'
],
new
DateTimeZone(
'UTC'
));
126
}
127
128
yield
new
ilPDSelectedItemBlockMembershipsDTO
(
129
(
int
) $row[
'ref_id'
],
130
(
int
) $row[
'obj_id'
],
131
(
string
) $row[
'type'
],
132
(
string
) $row[
'title'
],
133
(
string
) $row[
'description'
],
134
(
int
) $row[
'parent'
],
135
(
int
) $row[
'parent_lft'
],
136
(
bool
) $row[
'period_has_time'
],
137
$periodStart,
138
$periodEnd
139
);
140
}
141
}
142
}
DateTimeImmutable
ilPDSelectedItemsBlockMembershipsObjectDatabaseRepository\getForUser
getForUser(ilObjUser $user, array $objTypes, string $actorLanguageCode)
Definition:
class.ilPDSelectedItemsBlockMembershipsObjectDatabaseRepository.php:49
ilPDSelectedItemsBlockMembershipsObjectDatabaseRepository\$recoveryFolderId
$recoveryFolderId
Definition:
class.ilPDSelectedItemsBlockMembershipsObjectDatabaseRepository.php:30
ilPDSelectedItemsBlockMembershipsObjectDatabaseRepository
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilPDSelectedItemsBlockMembershipsObjectDatabaseRepository.php:20
ilPDSelectedItemsBlockMembershipsObjectDatabaseRepository\getValidObjectTypes
getValidObjectTypes()
Definition:
class.ilPDSelectedItemsBlockMembershipsObjectDatabaseRepository.php:41
ilPDSelectedItemsBlockMembershipsObjectDatabaseRepository\__construct
__construct(ilDBInterface $db, int $recoveryFolderId)
Definition:
class.ilPDSelectedItemsBlockMembershipsObjectDatabaseRepository.php:32
ilPDSelectedItemsBlockMembershipsObjectRepository
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
interface.ilPDSelectedItemsBlockMembershipsObjectRepository.php:20
ilObjUser
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilObject\getId
getId()
get object id public
Definition:
class.ilObject.php:319
ilDBInterface
ilPDSelectedItemBlockMembershipsDTO
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilPDSelectedItemBlockMembershipsDTO.php:19
ilPDSelectedItemsBlockMembershipsObjectDatabaseRepository\VALID_OBJECT_TYPES
const VALID_OBJECT_TYPES
Definition:
class.ilPDSelectedItemsBlockMembershipsObjectDatabaseRepository.php:22
Generator
ilPDSelectedItemsBlockMembershipsObjectDatabaseRepository\$db
$db
Definition:
class.ilPDSelectedItemsBlockMembershipsObjectDatabaseRepository.php:28
Services
Dashboard
ItemsBlock
classes
class.ilPDSelectedItemsBlockMembershipsObjectDatabaseRepository.php
Generated on Sun Apr 6 2025 21:01:30 for ILIAS by
1.8.13 (using
Doxyfile
)