ILIAS  release_8 Revision v8.24
ilECSNodeMappingAssignments Class Reference
+ Collaboration diagram for ilECSNodeMappingAssignments:

Static Public Member Functions

static lookupSettings (int $a_server_id, int $a_mid, int $a_tree_id, int $a_node_id)
 Lookup Settings. More...
 
static lookupAssignmentIds (int $a_server_id, int $a_mid, int $a_tree_id)
 Lookup assignments. More...
 
static lookupAssignmentsByRefId (int $a_server_id, int $a_mid, int $a_tree_id, int $a_ref_id)
 Lookup assignments. More...
 
static isWholeTreeMapped (int $a_server_id, int $a_mid, int $a_tree_id)
 Check if whole tree is mapped. More...
 
static lookupDefaultTitleUpdate ($a_server_id, $a_mid, $a_tree_id)
 Lookup default title update setting. More...
 
static lookupMappedItemsForRefId (int $a_server_id, int $a_mid, int $a_tree_id, int $a_ref_id)
 Get cs ids for ref_id. More...
 
static deleteMappingsByCsId (int $a_server_id, int $a_mid, int $a_tree_id, array $cs_ids)
 Delete mappings. More...
 
static deleteMappings (int $a_server_id, int $a_mid, int $a_tree_id)
 Delete mappings. More...
 
static deleteDisconnectableMappings (int $a_server_id, int $a_mid, int $a_tree_id, int $a_ref_id)
 delete disconnectable mappings More...
 

Detailed Description

Member Function Documentation

◆ deleteDisconnectableMappings()

static ilECSNodeMappingAssignments::deleteDisconnectableMappings ( int  $a_server_id,
int  $a_mid,
int  $a_tree_id,
int  $a_ref_id 
)
static

delete disconnectable mappings

Definition at line 227 of file class.ilECSNodeMappingAssignments.php.

227 : void
228 {
229 $toDelete = array();
230 foreach (self::lookupAssignmentsByRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id) as $assignment) {
231 $status = ilECSCmsData::lookupStatusByCmsId($a_server_id, $a_mid, $a_tree_id, $assignment);
232
233 switch ($status) {
238 $toDelete[] = $assignment;
239 break;
240
242 break;
243
244 }
245 }
246 self::deleteMappingsByCsId($a_server_id, $a_mid, $a_tree_id, $toDelete);
247 }
const MAPPING_PENDING_DISCONNECTABLE
const MAPPING_PENDING_NOT_DISCONNECTABLE
static lookupStatusByCmsId(int $a_server_id, int $a_mid, int $a_tree_id, string $cms_id)
Lookup status.
static deleteMappingsByCsId(int $a_server_id, int $a_mid, int $a_tree_id, array $cs_ids)
Delete mappings.

References deleteMappingsByCsId(), ilECSCmsData\lookupStatusByCmsId(), ilECSCmsData\MAPPING_DELETED, ilECSCmsData\MAPPING_MAPPED, ilECSCmsData\MAPPING_PENDING_DISCONNECTABLE, ilECSCmsData\MAPPING_PENDING_NOT_DISCONNECTABLE, and ilECSCmsData\MAPPING_UNMAPPED.

Referenced by ilECSMappingSettingsGUI\dMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteMappings()

static ilECSNodeMappingAssignments::deleteMappings ( int  $a_server_id,
int  $a_mid,
int  $a_tree_id 
)
static

Delete mappings.

Definition at line 210 of file class.ilECSNodeMappingAssignments.php.

210 : bool
211 {
212 global $DIC;
213
214 $ilDB = $DIC['ilDB'];
215
216 $query = 'DELETE FROM ecs_node_mapping_a ' .
217 'WHERE server_id = ' . $ilDB->quote($a_server_id) . ' ' .
218 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
219 'AND cs_root = ' . $ilDB->quote($a_tree_id, 'integer') . ' ';
220 $ilDB->manipulate($query);
221 return true;
222 }
global $DIC
Definition: feed.php:28
$query

References $DIC, $ilDB, and $query.

Referenced by ilECSMappingSettingsGUI\dDeleteTree(), and ilECSCmsTreeCommandQueueHandler\handleDelete().

+ Here is the caller graph for this function:

◆ deleteMappingsByCsId()

static ilECSNodeMappingAssignments::deleteMappingsByCsId ( int  $a_server_id,
int  $a_mid,
int  $a_tree_id,
array  $cs_ids 
)
static

Delete mappings.

Definition at line 192 of file class.ilECSNodeMappingAssignments.php.

192 : bool
193 {
194 global $DIC;
195
196 $ilDB = $DIC['ilDB'];
197
198 $query = 'DELETE FROM ecs_node_mapping_a ' .
199 'WHERE server_id = ' . $ilDB->quote($a_server_id) . ' ' .
200 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
201 'AND cs_root = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
202 'AND ' . $ilDB->in('cs_id', $cs_ids, false, 'integer');
203 $ilDB->manipulate($query);
204 return true;
205 }

References $DIC, $ilDB, and $query.

Referenced by deleteDisconnectableMappings(), and ilECSMappingSettingsGUI\dMap().

+ Here is the caller graph for this function:

◆ isWholeTreeMapped()

static ilECSNodeMappingAssignments::isWholeTreeMapped ( int  $a_server_id,
int  $a_mid,
int  $a_tree_id 
)
static

Check if whole tree is mapped.

Definition at line 127 of file class.ilECSNodeMappingAssignments.php.

127 : bool
128 {
129 global $DIC;
130
131 $ilDB = $DIC['ilDB'];
132
133 $query = 'SELECT depth FROM ecs_node_mapping_a ' .
134 'JOIN ecs_cms_tree ON (tree = cs_root AND child = cs_id) ' .
135 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
136 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
137 'AND cs_root = ' . $ilDB->quote($a_tree_id, 'integer') . ' ';
138 $res = $ilDB->query($query);
139 if ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
140 return $row->depth === 1;
141 }
142 return false;
143 }
$res
Definition: ltiservices.php:69

References $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSMappingUtils\lookupMappingStatus().

+ Here is the caller graph for this function:

◆ lookupAssignmentIds()

static ilECSNodeMappingAssignments::lookupAssignmentIds ( int  $a_server_id,
int  $a_mid,
int  $a_tree_id 
)
static

Lookup assignments.

Definition at line 80 of file class.ilECSNodeMappingAssignments.php.

80 : array
81 {
82 global $DIC;
83
84 $ilDB = $DIC['ilDB'];
85
86 $query = 'SELECT cs_id FROM ecs_node_mapping_a ' .
87 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
88 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
89 'AND cs_root = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
90 'AND ref_id > 0';
91 $res = $ilDB->query($query);
92
93 $assignments = array();
94 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
95 $assignments[] = $row->cs_id;
96 }
97 return $assignments;
98 }

References $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSCmsData\updateStatus().

+ Here is the caller graph for this function:

◆ lookupAssignmentsByRefId()

static ilECSNodeMappingAssignments::lookupAssignmentsByRefId ( int  $a_server_id,
int  $a_mid,
int  $a_tree_id,
int  $a_ref_id 
)
static

Lookup assignments.

Definition at line 103 of file class.ilECSNodeMappingAssignments.php.

103 : array
104 {
105 global $DIC;
106
107 $ilDB = $DIC['ilDB'];
108
109 $query = 'SELECT cs_id FROM ecs_node_mapping_a ' .
110 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
111 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
112 'AND cs_root = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
113 'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer') . ' ';
114 $res = $ilDB->query($query);
115
116 $assignments = array();
117 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
118 $assignments[] = $row->cs_id;
119 }
120 return $assignments;
121 }

References $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

◆ lookupDefaultTitleUpdate()

static ilECSNodeMappingAssignments::lookupDefaultTitleUpdate (   $a_server_id,
  $a_mid,
  $a_tree_id 
)
static

Lookup default title update setting.

Definition at line 148 of file class.ilECSNodeMappingAssignments.php.

148 : bool
149 {
150 global $DIC;
151
152 $ilDB = $DIC['ilDB'];
153
154 $query = 'SELECT title_update FROM ecs_node_mapping_a ' .
155 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
156 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
157 'AND cs_root = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
158 'AND cs_id = ' . $ilDB->quote(0, 'integer') . ' ';
159 $res = $ilDB->query($query);
160 if ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
161 return (bool) $row->title_update;
162 }
163 return false;
164 }

References $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSMappingSettingsGUI\dMap().

+ Here is the caller graph for this function:

◆ lookupMappedItemsForRefId()

static ilECSNodeMappingAssignments::lookupMappedItemsForRefId ( int  $a_server_id,
int  $a_mid,
int  $a_tree_id,
int  $a_ref_id 
)
static

Get cs ids for ref_id.

Definition at line 169 of file class.ilECSNodeMappingAssignments.php.

169 : array
170 {
171 global $DIC;
172
173 $ilDB = $DIC['ilDB'];
174
175 $query = 'SELECT cs_id FROM ecs_node_mapping_a ' .
176 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
177 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
178 'AND cs_root = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
179 'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer') . ' ';
180 $res = $ilDB->query($query);
181
182 $cs_ids = array();
183 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
184 $cs_ids[] = $row->cs_id;
185 }
186 return $cs_ids;
187 }

References $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSMappingSettingsGUI\dShowCmsExplorer().

+ Here is the caller graph for this function:

◆ lookupSettings()

static ilECSNodeMappingAssignments::lookupSettings ( int  $a_server_id,
int  $a_mid,
int  $a_tree_id,
int  $a_node_id 
)
static

Lookup Settings.

Returns
array|false false in case of no specific setting available, array of settings

Definition at line 51 of file class.ilECSNodeMappingAssignments.php.

52 {
53 global $DIC;
54
55 $ilDB = $DIC['ilDB'];
56
57 $query = 'SELECT title_update, position_update, tree_update FROM ecs_node_mapping_a ' .
58 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
59 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
60 'AND cs_root = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
61 'AND cs_id = ' . $ilDB->quote($a_node_id, 'integer');
62 $res = $ilDB->query($query);
63
64 if (!$res->numRows()) {
65 return false;
66 }
67
68 $settings = [];
69 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
70 $settings['title_update'] = $row->title_update;
71 $settings['position_update'] = $row->position_update;
72 $settings['tree_update'] = $row->tree_update;
73 }
74 return $settings;
75 }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200

References $DIC, $ilDB, $query, $res, ILIAS\LTI\ToolProvider\$settings, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSCmsTreeSynchronizer\sync().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: