ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 234 of file class.ilECSNodeMappingAssignments.php.

235 {
236 global $ilDB;
237
238 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
239 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
240
241 $toDelete = array();
242 foreach (self::lookupAssignmentsByRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id) as $assignment) {
243 $status = ilECSCmsData::lookupStatusByCmsId($a_server_id, $a_mid, $a_tree_id, $assignment);
244
245 switch ($status) {
247 $toDelete[] = $assignment;
248 break;
249
251 $toDelete[] = $assignment;
252 break;
254 break;
255
257 $toDelete[] = $assignment;
258 break;
259
261 $toDelete[] = $assignment;
262 break;
263 }
264 }
265 self::deleteMappingsByCsId($a_server_id, $a_mid, $a_tree_id, $toDelete);
266 }
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 $ilDB

References $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 216 of file class.ilECSNodeMappingAssignments.php.

217 {
218 global $ilDB;
219
220 $query = 'DELETE FROM ecs_node_mapping_a ' .
221 'WHERE server_id = ' . $ilDB->quote($a_server_id) . ' ' .
222 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
223 'AND cs_root = ' . $ilDB->quote($a_tree_id, 'integer') . ' ';
224 $ilDB->manipulate($query);
225 return true;
226 }
$query

References $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 195 of file class.ilECSNodeMappingAssignments.php.

196 {
197 global $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 $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 $ilDB;
23
24 $query = 'SELECT ref_id FROM ecs_node_mapping_a ' .
25 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
26 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
27 'AND cs_root = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
28 'AND ref_id > 0';
29 $res = $ilDB->query($query);
30 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
31 return true;
32 }
33 return false;
34 }
foreach($_POST as $key=> $value) $res

References $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 123 of file class.ilECSNodeMappingAssignments.php.

124 {
125 global $ilDB;
126
127 $query = 'SELECT depth FROM ecs_node_mapping_a ' .
128 'JOIN ecs_cms_tree ON (tree = cs_root AND child = cs_id) ' .
129 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
130 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
131 'AND cs_root = ' . $ilDB->quote($a_tree_id, 'integer') . ' ';
132 $res = $ilDB->query($query);
133 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
134 return $row->depth == 1;
135 }
136 return false;
137 }

References $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 75 of file class.ilECSNodeMappingAssignments.php.

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

References $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 99 of file class.ilECSNodeMappingAssignments.php.

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

References $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 142 of file class.ilECSNodeMappingAssignments.php.

143 {
144 global $ilDB;
145
146 $query = 'SELECT title_update FROM ecs_node_mapping_a ' .
147 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
148 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
149 'AND cs_root = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
150 'AND cs_id = ' . $ilDB->quote(0, 'integer') . ' ';
151 $res = $ilDB->query($query);
152 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
153 return (bool) $row->title_update;
154 }
155 return false;
156 }

References $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 167 of file class.ilECSNodeMappingAssignments.php.

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

References $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 44 of file class.ilECSNodeMappingAssignments.php.

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

References $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: