ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 228 of file class.ilECSNodeMappingAssignments.php.

228 : void
229 {
230 $toDelete = array();
231 foreach (self::lookupAssignmentsByRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id) as $assignment) {
232 $status = ilECSCmsData::lookupStatusByCmsId($a_server_id, $a_mid, $a_tree_id, $assignment);
233
234 switch ($status) {
239 $toDelete[] = $assignment;
240 break;
241
243 break;
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 211 of file class.ilECSNodeMappingAssignments.php.

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

References $DIC, and $ilDB.

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 193 of file class.ilECSNodeMappingAssignments.php.

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

References $DIC, and $ilDB.

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 128 of file class.ilECSNodeMappingAssignments.php.

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

References $DIC, $ilDB, $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 81 of file class.ilECSNodeMappingAssignments.php.

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

References $DIC, $ilDB, $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 104 of file class.ilECSNodeMappingAssignments.php.

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

References $DIC, $ilDB, $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 149 of file class.ilECSNodeMappingAssignments.php.

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

References $DIC, $ilDB, $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 170 of file class.ilECSNodeMappingAssignments.php.

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

References $DIC, $ilDB, $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 52 of file class.ilECSNodeMappingAssignments.php.

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

References $DIC, $ilDB, $res, 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: