ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 $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 <type> $ilDB. More...
 
static deleteMappingsByCsId ($a_server_id, $a_mid, $a_tree_id, $cs_ids)
 Delete mappings $ilDB. More...
 
static deleteMappings ($a_server_id, $a_mid, $a_tree_id)
 Delete mappings $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 242 of file class.ilECSNodeMappingAssignments.php.

References $ilDB, array, 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().

243  {
244  global $ilDB;
245 
246  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
247  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
248 
249  $toDelete = array();
250  foreach(self::lookupAssignmentsByRefId($a_server_id, $a_mid, $a_tree_id,$a_ref_id) as $assignment)
251  {
252  $status = ilECSCmsData::lookupStatusByCmsId($a_server_id, $a_mid, $a_tree_id, $assignment);
253 
254  switch($status)
255  {
257  $toDelete[] = $assignment;
258  break;
259 
261  $toDelete[] = $assignment;
262  break;
264  break;
265 
267  $toDelete[] = $assignment;
268  break;
269 
271  $toDelete[] = $assignment;
272  break;
273  }
274  }
275  self::deleteMappingsByCsId($a_server_id, $a_mid, $a_tree_id, $toDelete);
276  }
const MAPPING_PENDING_DISCONNECTABLE
static lookupStatusByCmsId($a_server_id, $a_mid, $a_tree_id, $cms_id)
Lookup status.
Create styles array
The data for the language used.
global $ilDB
const MAPPING_PENDING_NOT_DISCONNECTABLE
+ 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 $ilDB $ilDB.

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

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

References $ilDB, and $query.

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

225  {
226  global $ilDB;
227 
228  $query = 'DELETE FROM ecs_node_mapping_a '.
229  'WHERE server_id = '.$ilDB->quote($a_server_id).' '.
230  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
231  'AND cs_root = '.$ilDB->quote($a_tree_id,'integer').' ';
232  $ilDB->manipulate($query);
233  return true;
234  }
global $ilDB
+ 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 $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 203 of file class.ilECSNodeMappingAssignments.php.

References $ilDB, and $query.

Referenced by ilECSMappingSettingsGUI\dMap().

204  {
205  global $ilDB;
206 
207  $query = 'DELETE FROM ecs_node_mapping_a '.
208  'WHERE server_id = '.$ilDB->quote($a_server_id).' '.
209  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
210  'AND cs_root = '.$ilDB->quote($a_tree_id,'integer').' '.
211  'AND '.$ilDB->in('cs_id',$cs_ids,false,'integer');
212  $ilDB->manipulate($query);
213  return true;
214  }
global $ilDB
+ 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.

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

Referenced by ilECSMappingUtils\lookupMappingStatus().

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  {
32  return true;
33  }
34  return false;
35  }
global $ilDB
+ 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 128 of file class.ilECSNodeMappingAssignments.php.

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

Referenced by ilECSMappingUtils\lookupMappingStatus().

129  {
130  global $ilDB;
131 
132  $query = 'SELECT depth FROM ecs_node_mapping_a '.
133  'JOIN ecs_cms_tree ON (tree = cs_root AND child = cs_id) '.
134  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
135  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
136  'AND cs_root = '.$ilDB->quote($a_tree_id,'integer').' ';
137  $res = $ilDB->query($query);
138  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
139  {
140  return $row->depth == 1;
141  }
142  return false;
143  }
global $ilDB
+ Here is the caller graph for this function:

◆ lookupAssignmentIds()

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

Lookup assignments $ilDB.

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

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

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

Referenced by ilECSCmsData\updateStatus().

79  {
80  global $ilDB;
81 
82  $query = 'SELECT cs_id FROM ecs_node_mapping_a '.
83  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer'). ' '.
84  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
85  'AND cs_root = '.$ilDB->quote($a_tree_id,'integer').' '.
86  'AND ref_id > 0';
87  $res = $ilDB->query($query);
88 
89  $assignments = array();
90  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
91  {
92  $assignments[] = $row->cs_id;
93  }
94  return $assignments;
95  }
Create styles array
The data for the language used.
global $ilDB
+ 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 103 of file class.ilECSNodeMappingAssignments.php.

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

Referenced by ilECSMappingSettingsGUI\dShowCmsExplorer().

104  {
105  global $ilDB;
106 
107  $query = 'SELECT cs_id FROM ecs_node_mapping_a '.
108  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer'). ' '.
109  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
110  'AND cs_root = '.$ilDB->quote($a_tree_id,'integer').' '.
111  'AND ref_id = '.$ilDB->quote($a_ref_id,'integer').' ';
112  $res = $ilDB->query($query);
113 
114  $assignments = array();
115  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
116  {
117  $assignments[] = $row->cs_id;
118  }
119  return $assignments;
120  }
Create styles array
The data for the language used.
global $ilDB
+ 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 148 of file class.ilECSNodeMappingAssignments.php.

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

Referenced by ilECSMappingSettingsGUI\dMap().

149  {
150  global $ilDB;
151 
152  $query = 'SELECT title_update FROM ecs_node_mapping_a '.
153  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
154  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
155  'AND cs_root = '.$ilDB->quote($a_tree_id,'integer').' '.
156  'AND cs_id = '.$ilDB->quote(0,'integer').' ';
157  $res = $ilDB->query($query);
158  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
159  {
160  return (bool) $row->title_update;
161  }
162  return false;
163  }
global $ilDB
+ 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 <type> $ilDB.

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

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

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

Referenced by ilECSMappingSettingsGUI\dShowCmsExplorer().

175  {
176  global $ilDB;
177 
178  $query = 'SELECT cs_id FROM ecs_node_mapping_a '.
179  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
180  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
181  'AND cs_root = '.$ilDB->quote($a_tree_id,'integer').' '.
182  'AND ref_id = '.$ilDB->quote($a_ref_id,'integer').' ';
183  $res = $ilDB->query($query);
184 
185  $cs_ids = array();
186  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
187  {
188  $cs_ids[] = $row->cs_id;
189  }
190  return $cs_ids;
191  }
Create styles array
The data for the language used.
global $ilDB
+ 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 45 of file class.ilECSNodeMappingAssignments.php.

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

Referenced by ilECSCmsTreeSynchronizer\sync().

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

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