ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilECSNodeMappingAssignments Class Reference
+ Collaboration diagram for ilECSNodeMappingAssignments:

Static Public Member Functions

static hasAssignments ($a_server_id, $a_mid, $a_tree_id)
 Check if there is any assignment for a cms tree. More...
 
static lookupSettings ($a_server_id, $a_mid, $a_tree_id, $a_node_id)
 Lookup Settings. More...
 
static lookupAssignmentIds ($a_server_id, $a_mid, $a_tree_id)
 Lookup assignments @global $ilDB. More...
 
static lookupAssignmentsByRefId ($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
 Lookup assignments. More...
 
static isWholeTreeMapped ($a_server_id, $a_mid, $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 ($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
 Get cs ids for ref_id @global <type> $ilDB. More...
 
static deleteMappingsByCsId ($a_server_id, $a_mid, $a_tree_id, $cs_ids)
 Delete mappings @global $ilDB. More...
 
static deleteMappings ($a_server_id, $a_mid, $a_tree_id)
 Delete mappings @global $ilDB $ilDB. More...
 
static deleteDisconnectableMappings ($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
 delete disconnectable mappings More...
 

Detailed Description

Member Function Documentation

◆ deleteDisconnectableMappings()

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

delete disconnectable mappings

Parameters
<type>$a_server_id
<type>$a_mid
<type>$a_tree_id

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

253 {
254 global $DIC;
255
256 $ilDB = $DIC['ilDB'];
257
258 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
259 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
260
261 $toDelete = array();
262 foreach (self::lookupAssignmentsByRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id) as $assignment) {
263 $status = ilECSCmsData::lookupStatusByCmsId($a_server_id, $a_mid, $a_tree_id, $assignment);
264
265 switch ($status) {
267 $toDelete[] = $assignment;
268 break;
269
271 $toDelete[] = $assignment;
272 break;
274 break;
275
277 $toDelete[] = $assignment;
278 break;
279
281 $toDelete[] = $assignment;
282 break;
283 }
284 }
285 self::deleteMappingsByCsId($a_server_id, $a_mid, $a_tree_id, $toDelete);
286 }
const MAPPING_PENDING_DISCONNECTABLE
const MAPPING_PENDING_NOT_DISCONNECTABLE
static lookupStatusByCmsId($a_server_id, $a_mid, $a_tree_id, $cms_id)
Lookup status.
static deleteMappingsByCsId($a_server_id, $a_mid, $a_tree_id, $cs_ids)
Delete mappings @global $ilDB.
global $DIC
Definition: saml.php:7
global $ilDB

References $DIC, $ilDB, 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 (   $a_server_id,
  $a_mid,
  $a_tree_id 
)
static

Delete mappings @global $ilDB $ilDB.

Parameters
<type>$a_server_id
<type>$a_mid
<type>$a_tree_id
Returns
<type>

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

233 {
234 global $DIC;
235
236 $ilDB = $DIC['ilDB'];
237
238 $query = 'DELETE FROM ecs_node_mapping_a ' .
239 'WHERE server_id = ' . $ilDB->quote($a_server_id) . ' ' .
240 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
241 'AND cs_root = ' . $ilDB->quote($a_tree_id, 'integer') . ' ';
242 $ilDB->manipulate($query);
243 return true;
244 }
$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 (   $a_server_id,
  $a_mid,
  $a_tree_id,
  $cs_ids 
)
static

Delete mappings @global $ilDB.

Parameters
<type>$a_server_id
<type>$a_mid
<type>$a_tree_id
<type>$a_ref_id
<type>$cs_ids
Returns
<type>

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

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

References $DIC, $ilDB, and $query.

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

+ Here is the caller graph for this function:

◆ hasAssignments()

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

Check if there is any assignment for a cms tree.

Parameters
int$a_server_id
int$a_tree_id

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

21 {
22 global $DIC;
23
24 $ilDB = $DIC['ilDB'];
25
26 $query = 'SELECT ref_id FROM ecs_node_mapping_a ' .
27 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
28 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
29 'AND cs_root = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
30 'AND ref_id > 0';
31 $res = $ilDB->query($query);
32 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
33 return true;
34 }
35 return false;
36 }
$row
foreach($_POST as $key=> $value) $res

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

Referenced by ilECSMappingUtils\lookupMappingStatus().

+ Here is the caller graph for this function:

◆ isWholeTreeMapped()

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

Check if whole tree is mapped.

Parameters
int$a_server_id
int$a_tree_id

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

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

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

Referenced by ilECSMappingUtils\lookupMappingStatus().

+ Here is the caller graph for this function:

◆ lookupAssignmentIds()

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

Lookup assignments @global $ilDB.

Parameters
<type>$a_server_id
<type>$a_mid
<type>$a_tree_id

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

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

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

Referenced by ilECSCmsData\updateStatus().

+ Here is the caller graph for this function:

◆ lookupAssignmentsByRefId()

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

Lookup assignments.

Parameters
<type>$a_server_id
<type>$a_mid
<type>$a_tree_id

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

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

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

Referenced by ilECSMappingSettingsGUI\dShowCmsExplorer().

+ Here is the caller graph for this function:

◆ lookupDefaultTitleUpdate()

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

Lookup default title update setting.

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

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

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

Referenced by ilECSMappingSettingsGUI\dMap().

+ Here is the caller graph for this function:

◆ lookupMappedItemsForRefId()

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

Get cs ids for ref_id @global <type> $ilDB.

Parameters
<type>$a_server_id
<type>$a_mid
<type>$a_tree_id
<type>$a_ref_id
Returns
<type>

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

180 {
181 global $DIC;
182
183 $ilDB = $DIC['ilDB'];
184
185 $query = 'SELECT cs_id FROM ecs_node_mapping_a ' .
186 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
187 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
188 'AND cs_root = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
189 'AND ref_id = ' . $ilDB->quote($a_ref_id, 'integer') . ' ';
190 $res = $ilDB->query($query);
191
192 $cs_ids = array();
193 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
194 $cs_ids[] = $row->cs_id;
195 }
196 return $cs_ids;
197 }

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

Referenced by ilECSMappingSettingsGUI\dShowCmsExplorer().

+ Here is the caller graph for this function:

◆ lookupSettings()

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

Lookup Settings.

Parameters
type$a_server_id
type$a_mid
type$a_tree_id
Returns
mixed false in case of no specific setting available, array of settings

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

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

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