19declare(strict_types=1);
47 $objTypes = array_intersect($objTypes, self::VALID_OBJECT_TYPES);
48 if ($objTypes === []) {
52 $odObjTypes =
' AND ' . $this->db->in(
59 $res = $this->db->queryF(
66 WHEN (trans.title IS NOT NULL AND trans.title != '')
73 WHEN (trans.description IS NOT NULL AND trans.description != '')
74 THEN trans.description
83 WHEN od.type = 'crs' THEN crs_settings.period_start
84 ELSE grp_settings.period_start
89 WHEN od.type = 'crs' THEN crs_settings.period_end
90 ELSE grp_settings.period_end
95 WHEN od.type = 'crs' THEN crs_settings.period_time_indication
96 ELSE grp_settings.period_time_indication
100 INNER JOIN rbac_fa fa ON fa.rol_id = ua.rol_id AND fa.assign = %s
101 INNER JOIN object_reference objr ON objr.ref_id = fa.parent
102 INNER JOIN object_data od ON od.obj_id = objr.obj_id $odObjTypes
103 INNER JOIN tree t ON t.child = objr.ref_id AND t.tree = %s AND t.parent != %s
104 INNER JOIN tree tp ON tp.child = t.parent
105 LEFT JOIN grp_settings ON grp_settings.obj_id = od.obj_id
106 LEFT JOIN crs_settings ON crs_settings.obj_id = od.obj_id
107 LEFT JOIN object_translation trans ON trans.obj_id = od.obj_id AND trans.lang_code = %s
111 [
'y', 1, $this->recoveryFolderId, $actorLanguageCode, $user->
getId()]
114 while ($row = $this->db->fetchAssoc(
$res)) {
116 if (!is_null($row[
'period_start'])) {
117 $periodStart =
new DateTimeImmutable($row[
'period_start'],
new DateTimeZone(
'UTC'));
120 if (!is_null($row[
'period_end'])) {
121 $periodEnd =
new DateTimeImmutable($row[
'period_end'],
new DateTimeZone(
'UTC'));
125 (
int) $row[
'ref_id'],
126 (
int) $row[
'obj_id'],
127 (
string) $row[
'type'],
128 (
string) $row[
'title'],
129 (
string) $row[
'description'],
130 (
int) $row[
'parent'],
131 (
int) $row[
'parent_lft'],
132 (
bool) $row[
'period_has_time'],
__construct(ilDBInterface $db, int $recoveryFolderId)
getForUser(ilObjUser $user, array $objTypes, string $actorLanguageCode)