ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilECSCmsData Class Reference
+ Collaboration diagram for ilECSCmsData:

Public Member Functions

 __construct ($a_obj_id=0)
 
 setTitle ($a_title)
 
 getTitle ()
 
 setTerm ($a_term)
 
 getTerm ()
 
 setObjId ($a_id)
 
 getObjId ()
 
 setCmsId ($a_id)
 
 getCmsId ()
 
 setServerId ($a_id)
 
 getServerId ()
 
 setTreeId ($a_id)
 
 getTreeId ()
 
 setMid ($a_id)
 
 getMid ()
 
 setStatus ($a_status)
 
 getStatus ()
 
 setDeleted ($a_is_deleted)
 
 isDeleted ()
 
 save ()
 
 update ()
 
 delete ()
 
 deleteTree ()
 

Static Public Member Functions

static treeExists ($a_server_id, $a_mid, $a_tree_id)
 
static findDeletedNodes ($a_server_id, $a_mid, $a_tree_id)
 Find deleted nodes Uses a left join since this is more robust. More...
 
static lookupObjId ($a_server_id, $a_mid, $a_tree_id, $cms_id)
 
static lookupFirstTreeOfNode ($a_server_id, $a_mid, $cms_id)
 Lookup first obj_id of cms node $ilDB $ilDB. More...
 
static lookupTitle ($a_server_id, $a_mid, $a_tree_id)
 Lookup title by obj id. More...
 
static lookupTopTerm ($a_server_id, $a_mid, $a_tree_id)
 Lookup term (highest term in cms tree) <type> $ilDB. More...
 
static lookupStatusByObjId ($a_server_id, $a_mid, $a_tree_id, $obj_id)
 Lookup status. More...
 
static lookupStatusByCmsId ($a_server_id, $a_mid, $a_tree_id, $cms_id)
 Lookup status. More...
 
static updateStatus ($a_server_id, $a_mid, $a_tree_id)
 
static lookupCmsId ($a_obj_id)
 Lookup cms id. More...
 
static lookupCmsIds ($a_obj_ids)
 
static lookupCmsIdsOfTree ($a_server_id, $a_mid, $a_tree_id)
 $ilDB $ilDB More...
 
static writeStatus ($a_server_id, $a_mid, $a_tree_id, $cms_ids, $status)
 Update status $ilDB. More...
 
static writeAllStatus ($a_server_id, $a_mid, $a_tree_id, $status)
 Update status $ilDB. More...
 
static writeAllDeleted ($a_server_id, $a_mid, $a_tree_id, $a_deleted_flag)
 Write deleted status. More...
 
static lookupTreeIds ($a_server_id, $a_mid)
 
static deleteByServerId ($a_server_id)
 

Data Fields

const MAPPING_UNMAPPED = 1
 
const MAPPING_PENDING_DISCONNECTABLE = 2
 
const MAPPING_PENDING_NOT_DISCONNECTABLE = 3
 
const MAPPING_MAPPED = 4
 
const MAPPING_DELETED = 5
 

Protected Member Functions

 read ()
 

Private Attributes

 $obj_id
 
 $server_id
 
 $mid
 
 $tree_id
 
 $cms_id
 
 $title
 
 $term
 
 $status = self::MAPPING_UNMAPPED
 
 $deleted = false
 

Detailed Description

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e $Id$

Definition at line 10 of file class.ilECSCmsData.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSCmsData::__construct (   $a_obj_id = 0)

Definition at line 29 of file class.ilECSCmsData.php.

References read().

30  {
31  $this->obj_id = $a_obj_id;
32  $this->read();
33  }
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilECSCmsData::delete ( )

Definition at line 506 of file class.ilECSCmsData.php.

References $ilDB, and $query.

507  {
508  global $ilDB;
509 
510  $query = "DELETE FROM ecs_cms_data ".
511  'WHERE obj_id = '.$ilDB->quote($this->obj_id,'integer');
512  $ilDB->manipulate($query);
513  }
global $ilDB

◆ deleteByServerId()

static ilECSCmsData::deleteByServerId (   $a_server_id)
static

Definition at line 526 of file class.ilECSCmsData.php.

References $ilDB, and $query.

Referenced by ilECSSetting\delete().

527  {
528  global $ilDB;
529 
530  $query = "DELETE FROM ecs_cms_data ".
531  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer');
532  $ilDB->manipulate($query);
533  }
global $ilDB
+ Here is the caller graph for this function:

◆ deleteTree()

ilECSCmsData::deleteTree ( )

Definition at line 515 of file class.ilECSCmsData.php.

References $ilDB, and $query.

516  {
517  global $ilDB;
518 
519  $query = "DELETE FROM ecs_cms_data ".
520  'WHERE server_id = '.$ilDB->quote($this->server_id,'integer').' '.
521  'AND mid = '.$ilDB->quote($this->mid,'integer').' '.
522  'AND tree_id = '.$ilDB->quote($this->tree_id,'integer').' ';
523  $ilDB->manipulate($query);
524  }
global $ilDB

◆ findDeletedNodes()

static ilECSCmsData::findDeletedNodes (   $a_server_id,
  $a_mid,
  $a_tree_id 
)
static

Find deleted nodes Uses a left join since this is more robust.

An alternative implementation could simply check the deleted flag in ecs_cms_data. $ilDB

Parameters
type$a_server_id
type$a_mid
type$a_tree_id
Returns
type

Definition at line 62 of file class.ilECSCmsData.php.

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

Referenced by ilECSCmsTreeCommandQueueHandler\handleUpdate().

63  {
64  global $ilDB;
65 
66  $query = 'SELECT ed.obj_id obj_id FROM ecs_cms_data ed '.
67  'LEFT JOIN ecs_cms_tree et ON ed.obj_id = et.child '.
68  'WHERE et.child IS NULL '.
69  'AND server_id = '.$ilDB->quote($a_server_id,'integer').' '.
70  'AND mid = '.$ilDB->quote($a_mid).' '.
71  'AND tree_id = '.$ilDB->quote($a_tree_id);
72  $res = $ilDB->query($query);
73 
74  $deleted = array();
75  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
76  {
77  $deleted[] = $row->obj_id;
78  }
79  return $deleted;
80  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ getCmsId()

ilECSCmsData::getCmsId ( )

Definition at line 415 of file class.ilECSCmsData.php.

References $cms_id.

416  {
417  return $this->cms_id;
418  }

◆ getMid()

ilECSCmsData::getMid ( )

Definition at line 445 of file class.ilECSCmsData.php.

References $mid.

446  {
447  return $this->mid;
448  }

◆ getObjId()

ilECSCmsData::getObjId ( )

Definition at line 405 of file class.ilECSCmsData.php.

References $obj_id.

406  {
407  return $this->obj_id;
408  }

◆ getServerId()

ilECSCmsData::getServerId ( )

Definition at line 425 of file class.ilECSCmsData.php.

References $server_id.

426  {
427  return $this->server_id;
428  }

◆ getStatus()

ilECSCmsData::getStatus ( )

Definition at line 455 of file class.ilECSCmsData.php.

References $status.

456  {
457  return $this->status;
458  }

◆ getTerm()

ilECSCmsData::getTerm ( )

Definition at line 395 of file class.ilECSCmsData.php.

References $term.

396  {
397  return $this->term;
398  }

◆ getTitle()

ilECSCmsData::getTitle ( )

Definition at line 385 of file class.ilECSCmsData.php.

References $title.

Referenced by ilECSNodeMappingTreeTableGUI\parse().

386  {
387  return $this->title;
388  }
+ Here is the caller graph for this function:

◆ getTreeId()

ilECSCmsData::getTreeId ( )

Definition at line 435 of file class.ilECSCmsData.php.

References $tree_id.

436  {
437  return $this->tree_id;
438  }

◆ isDeleted()

ilECSCmsData::isDeleted ( )

Definition at line 465 of file class.ilECSCmsData.php.

References $deleted.

Referenced by update().

466  {
467  return $this->deleted;
468  }
+ Here is the caller graph for this function:

◆ lookupCmsId()

static ilECSCmsData::lookupCmsId (   $a_obj_id)
static

Lookup cms id.

Parameters
type$a_obj_id

Definition at line 248 of file class.ilECSCmsData.php.

References array.

Referenced by ilECSMappingSettingsGUI\dInitFormTreeSettings().

249  {
250  $cms_ids = self::lookupCmsIds(array($a_obj_id));
251  return $cms_ids[0];
252  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ lookupCmsIds()

static ilECSCmsData::lookupCmsIds (   $a_obj_ids)
static

Definition at line 255 of file class.ilECSCmsData.php.

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

Referenced by ilECSCourseCreationHandler\syncNodeToTop().

256  {
257  global $ilDB;
258 
259  $query = 'SELECT cms_id FROM ecs_cms_data '.
260  'WHERE '.$ilDB->in('obj_id',$a_obj_ids,false,'integer');
261  $res = $ilDB->query($query);
262 
263  $cms_ids = array();
264  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
265  {
266  $cms_ids[] = $row->cms_id;
267  }
268  return $cms_ids;
269  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ lookupCmsIdsOfTree()

static ilECSCmsData::lookupCmsIdsOfTree (   $a_server_id,
  $a_mid,
  $a_tree_id 
)
static

$ilDB $ilDB

Parameters
type$a_server_id
type$a_mid
type$a_tree_id

Definition at line 278 of file class.ilECSCmsData.php.

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

Referenced by ilECSMappingSettingsGUI\dDeleteTree().

279  {
280  global $ilDB;
281 
282  $query = 'SELECT cms_id FROM ecs_cms_data '.
283  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
284  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
285  'AND tree_id = '.$ilDB->quote($a_tree_id,'integer');
286  $res = $ilDB->query($query);
287  $cms_ids = array();
288  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
289  {
290  $cms_ids[] = $row->cms_id;
291  }
292  return $cms_ids;
293  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ lookupFirstTreeOfNode()

static ilECSCmsData::lookupFirstTreeOfNode (   $a_server_id,
  $a_mid,
  $cms_id 
)
static

Lookup first obj_id of cms node $ilDB $ilDB.

Parameters
type$a_server_id
type$a_mid
type$cms_id
Returns
int

Definition at line 110 of file class.ilECSCmsData.php.

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

Referenced by ilECSCourseCreationHandler\syncParentContainer().

111  {
112  global $ilDB;
113 
114  $GLOBALS['ilLog']->write(__METHOD__.':ASDUASDUASDU '.$a_server_id.' '.$a_mid. ' '.$cms_id);
115 
116  $query = 'SELECT tree_id FROM ecs_cms_data '.
117  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
118  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
119  'AND cms_id = '.$ilDB->quote($cms_id,'text'). ' '.
120  'ORDER BY tree_id ';
121  $res = $ilDB->query($query);
122 
123  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
124  {
125  return $row->tree_id;
126  }
127  return 0;
128  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $ilDB
+ Here is the caller graph for this function:

◆ lookupObjId()

static ilECSCmsData::lookupObjId (   $a_server_id,
  $a_mid,
  $a_tree_id,
  $cms_id 
)
static

Definition at line 82 of file class.ilECSCmsData.php.

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

Referenced by ilECSCmsTreeCommandQueueHandler\handleCreate(), ilECSCmsTreeCommandQueueHandler\handleUpdate(), ilECSTreeReader\storeTree(), and ilECSCourseCreationHandler\syncNodeToTop().

83  {
84  global $ilDB;
85 
86  $query = 'SELECT obj_id FROM ecs_cms_data '.
87  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
88  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
89  'AND tree_id = '.$ilDB->quote($a_tree_id,'integer').' '.
90  'AND cms_id = '.$ilDB->quote($cms_id,'text');
91  $res = $ilDB->query($query);
92 
93  $GLOBALS['ilLog']->write(__METHOD__.': '.$query);
94 
95  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
96  {
97  return $row->obj_id;
98  }
99  return 0;
100  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $ilDB
+ Here is the caller graph for this function:

◆ lookupStatusByCmsId()

static ilECSCmsData::lookupStatusByCmsId (   $a_server_id,
  $a_mid,
  $a_tree_id,
  $cms_id 
)
static

Lookup status.

Parameters
int$a_obj_id

Definition at line 205 of file class.ilECSCmsData.php.

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

Referenced by ilECSNodeMappingAssignments\deleteDisconnectableMappings().

206  {
207  global $ilDB;
208 
209  $query = 'SELECT status FROM ecs_cms_data '.
210  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
211  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
212  'AND tree_id = '.$ilDB->quote($a_tree_id,'integer').' '.
213  'AND cms_id = '.$ilDB->quote($cms_id,'text');
214  $res = $ilDB->query($query);
215  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
216  {
217  return $row->status;
218  }
219  return self::MAPPING_UNMAPPED;
220  }
global $ilDB
+ Here is the caller graph for this function:

◆ lookupStatusByObjId()

static ilECSCmsData::lookupStatusByObjId (   $a_server_id,
  $a_mid,
  $a_tree_id,
  $obj_id 
)
static

Lookup status.

Parameters
int$a_obj_id

Definition at line 180 of file class.ilECSCmsData.php.

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

Referenced by ilECSNodeMappingCmsExplorer\buildFormItem(), and ilECSNodeMappingCmsExplorer\buildTitle().

181  {
182  global $ilDB;
183 
184  $query = 'SELECT status,deleted FROM ecs_cms_data '.
185  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
186  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
187  'AND tree_id = '.$ilDB->quote($a_tree_id,'integer').' '.
188  'AND obj_id = '.$ilDB->quote($obj_id,'integer');
189  $res = $ilDB->query($query);
190  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
191  {
192  if($row->deleted)
193  {
194  return self::MAPPING_DELETED;
195  }
196  return $row->status;
197  }
198  return self::MAPPING_UNMAPPED;
199  }
global $ilDB
+ Here is the caller graph for this function:

◆ lookupTitle()

static ilECSCmsData::lookupTitle (   $a_server_id,
  $a_mid,
  $a_tree_id 
)
static

Lookup title by obj id.

Parameters
int$a_obj_id

Definition at line 134 of file class.ilECSCmsData.php.

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

Referenced by ilECSMappingSettingsGUI\dConfirmDeleteTree().

135  {
136  global $ilDB;
137 
138  $query = 'SELECT * FROM ecs_cms_data '.
139  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
140  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
141  'AND tree_id = '.$ilDB->quote($a_tree_id,'integer');
142  $res = $ilDB->query($query);
143  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
144  {
145  return $row->title;
146  }
147  return '';
148  }
global $ilDB
+ Here is the caller graph for this function:

◆ lookupTopTerm()

static ilECSCmsData::lookupTopTerm (   $a_server_id,
  $a_mid,
  $a_tree_id 
)
static

Lookup term (highest term in cms tree) <type> $ilDB.

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

Definition at line 157 of file class.ilECSCmsData.php.

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

Referenced by ilECSNodeMappingTreeTableGUI\parse().

158  {
159  global $ilDB;
160 
161  $query = 'SELECT term FROM ecs_cms_data '.
162  'JOIN ecs_cms_tree ON obj_id = child '.
163  'WHERE tree = '.$ilDB->quote($a_tree_id,'integer').' '.
164  'AND server_id = '.$ilDB->quote($a_server_id,'integer').' '.
165  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
166  'AND tree_id = '.$ilDB->quote($a_tree_id,'integer').' '.
167  'ORDER BY depth';
168  $res = $ilDB->query($query);
169  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
170  {
171  return $row->term;
172  }
173  return '';
174  }
global $ilDB
+ Here is the caller graph for this function:

◆ lookupTreeIds()

static ilECSCmsData::lookupTreeIds (   $a_server_id,
  $a_mid 
)
static

Definition at line 362 of file class.ilECSCmsData.php.

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

Referenced by ilECSNodeMappingTreeTableGUI\parse().

363  {
364  global $ilDB;
365 
366  $query = 'SELECT DISTINCT(tree_id) tid FROM ecs_cms_data '.
367  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
368  'AND mid = '.$ilDB->quote($a_mid,'integer');
369  $res = $ilDB->query($query);
370 
371  $tree_ids = array();
372  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
373  {
374  $tree_ids[] = $row->tid;
375  }
376  return (array) $tree_ids;
377  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ read()

ilECSCmsData::read ( )
protected

Definition at line 535 of file class.ilECSCmsData.php.

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

Referenced by __construct().

536  {
537  global $ilDB;
538 
539  $query = 'SELECT * FROM ecs_cms_data '.
540  'WHERE obj_id = '.$ilDB->quote($this->obj_id,'integer');
541  $res = $ilDB->query($query);
542  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
543  {
544  $this->title = $row->title;
545  $this->term = $row->term;
546  $this->server_id = $row->server_id;
547  $this->mid = $row->mid;
548  $this->tree_id = $row->tree_id;
549  $this->cms_id = $row->cms_id;
550  $this->status = $row->status;
551  $this->deleted = $row->deleted;
552  }
553  }
global $ilDB
+ Here is the caller graph for this function:

◆ save()

ilECSCmsData::save ( )

Definition at line 471 of file class.ilECSCmsData.php.

References $ilDB, and $query.

472  {
473  global $ilDB;
474 
475  $this->obj_id = $ilDB->nextId('ecs_cms_data');
476 
477  $query = 'INSERT INTO ecs_cms_data (obj_id,server_id,mid,tree_id,cms_id,title,term,status,deleted) '.
478  'VALUES ( '.
479  $ilDB->quote($this->obj_id,'integer').', '.
480  $ilDB->quote($this->server_id, 'integer') . ', ' .
481  $ilDB->quote($this->mid,'integer').', '.
482  $ilDB->quote($this->tree_id,'integer').', '.
483  $ilDB->quote($this->cms_id,'text').', '.
484  $ilDB->quote($this->title,'text'). ', '.
485  $ilDB->quote($this->term,'text').', '.
486  $ilDB->quote($this->status,'integer').', '.
487  $ilDB->quote($this->deleted,'integer').' '.
488  ')';
489  $ilDB->manipulate($query);
490  return true;
491  }
global $ilDB

◆ setCmsId()

ilECSCmsData::setCmsId (   $a_id)

Definition at line 410 of file class.ilECSCmsData.php.

411  {
412  $this->cms_id = $a_id;
413  }

◆ setDeleted()

ilECSCmsData::setDeleted (   $a_is_deleted)

Definition at line 460 of file class.ilECSCmsData.php.

461  {
462  $this->deleted = $a_is_deleted;
463  }

◆ setMid()

ilECSCmsData::setMid (   $a_id)

Definition at line 440 of file class.ilECSCmsData.php.

441  {
442  $this->mid = $a_id;
443  }

◆ setObjId()

ilECSCmsData::setObjId (   $a_id)

Definition at line 400 of file class.ilECSCmsData.php.

401  {
402  $this->obj_id = $a_id;
403  }

◆ setServerId()

ilECSCmsData::setServerId (   $a_id)

Definition at line 420 of file class.ilECSCmsData.php.

421  {
422  $this->server_id = $a_id;
423  }

◆ setStatus()

ilECSCmsData::setStatus (   $a_status)

Definition at line 450 of file class.ilECSCmsData.php.

451  {
452  $this->status = $a_status;
453  }

◆ setTerm()

ilECSCmsData::setTerm (   $a_term)

Definition at line 390 of file class.ilECSCmsData.php.

391  {
392  $this->term = $a_term;
393  }

◆ setTitle()

ilECSCmsData::setTitle (   $a_title)

Definition at line 380 of file class.ilECSCmsData.php.

381  {
382  $this->title = $a_title;
383  }

◆ setTreeId()

ilECSCmsData::setTreeId (   $a_id)

Definition at line 430 of file class.ilECSCmsData.php.

431  {
432  $this->tree_id = $a_id;
433  }

◆ treeExists()

static ilECSCmsData::treeExists (   $a_server_id,
  $a_mid,
  $a_tree_id 
)
static

Definition at line 35 of file class.ilECSCmsData.php.

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

Referenced by ilECSTreeReader\read().

36  {
37  global $ilDB;
38 
39  $query = 'SELECT COUNT(*) num FROM ecs_cms_data '.
40  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
41  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
42  'AND tree_id = '.$ilDB->quote($a_tree_id,'integer');
43 
44  $res = $ilDB->query($query);
45  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
46  {
47  return $row->num > 0 ? true : false;
48  }
49  return false;
50  }
global $ilDB
+ Here is the caller graph for this function:

◆ update()

ilECSCmsData::update ( )

Definition at line 493 of file class.ilECSCmsData.php.

References $ilDB, $query, and isDeleted().

494  {
495  global $ilDB;
496 
497  $query = "UPDATE ecs_cms_data SET ".
498  'title = '.$ilDB->quote($this->title,'text').', '.
499  'term = '.$ilDB->quote($this->term,'text').', '.
500  'status = '.$ilDB->quote($this->status,'text').', '.
501  'deleted = '.$ilDB->quote($this->isDeleted(),'integer').' '.
502  'WHERE obj_id = '.$ilDB->quote($this->obj_id,'integer');
503  $ilDB->manipulate($query);
504  }
global $ilDB
+ Here is the call graph for this function:

◆ updateStatus()

static ilECSCmsData::updateStatus (   $a_server_id,
  $a_mid,
  $a_tree_id 
)
static

Definition at line 222 of file class.ilECSCmsData.php.

References array, and ilECSNodeMappingAssignments\lookupAssignmentIds().

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

223  {
224  // Set all status to pending unmapped
225  self::writeAllStatus($a_server_id, $a_mid, $a_tree_id, self::MAPPING_UNMAPPED);
226 
227  // Set mapped for mapped and their descendent
228  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
229  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
230  foreach(ilECSNodeMappingAssignments::lookupAssignmentIds($a_server_id, $a_mid, $a_tree_id) as $assignment)
231  {
232  $cmsTree = new ilECSCmsTree($a_tree_id);
233  $subIds = self::lookupCmsIds(array_merge($cmsTree->getSubTreeIds($assignment),array($assignment)));
234 
235  self::writeStatus(
236  $a_server_id,
237  $a_mid,
238  $a_tree_id,
239  $subIds,
240  self::MAPPING_MAPPED);
241  }
242  }
Create styles array
The data for the language used.
static lookupAssignmentIds($a_server_id, $a_mid, $a_tree_id)
Lookup assignments $ilDB.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeAllDeleted()

static ilECSCmsData::writeAllDeleted (   $a_server_id,
  $a_mid,
  $a_tree_id,
  $a_deleted_flag 
)
static

Write deleted status.

Parameters
type$a_server_id
type$a_mid
type$a_tree_id
type$a_deleted_flag

Definition at line 349 of file class.ilECSCmsData.php.

References $ilDB, and $query.

Referenced by ilECSCmsTreeCommandQueueHandler\handleUpdate().

350  {
351  global $ilDB;
352 
353  $query = 'UPDATE ecs_cms_data '.
354  'SET deleted = '.$ilDB->quote($a_deleted_flag,'integer'). ' '.
355  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
356  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
357  'AND tree_id = '.$ilDB->quote($a_tree_id,'integer').' ';
358  $ilDB->manipulate($query);
359  return true;
360  }
global $ilDB
+ Here is the caller graph for this function:

◆ writeAllStatus()

static ilECSCmsData::writeAllStatus (   $a_server_id,
  $a_mid,
  $a_tree_id,
  $status 
)
static

Update status $ilDB.

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

Definition at line 329 of file class.ilECSCmsData.php.

References $ilDB, $query, and $status.

330  {
331  global $ilDB;
332 
333  $query = 'UPDATE ecs_cms_data '.
334  'SET status = '.$ilDB->quote($status,'integer'). ' '.
335  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
336  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
337  'AND tree_id = '.$ilDB->quote($a_tree_id,'integer').' ';
338  $ilDB->manipulate($query);
339  return true;
340  }
global $ilDB

◆ writeStatus()

static ilECSCmsData::writeStatus (   $a_server_id,
  $a_mid,
  $a_tree_id,
  $cms_ids,
  $status 
)
static

Update status $ilDB.

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

Definition at line 305 of file class.ilECSCmsData.php.

References $ilDB, $query, and $status.

306  {
307  global $ilDB;
308 
309  $query = 'UPDATE ecs_cms_data '.
310  'SET status = '.$ilDB->quote($status,'integer'). ' '.
311  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
312  'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
313  'AND tree_id = '.$ilDB->quote($a_tree_id,'integer').' '.
314  'AND '. $ilDB->in('cms_id',$cms_ids,false,'text');
315  $ilDB->manipulate($query);
316  return true;
317  }
global $ilDB

Field Documentation

◆ $cms_id

ilECSCmsData::$cms_id
private

◆ $deleted

ilECSCmsData::$deleted = false
private

Definition at line 27 of file class.ilECSCmsData.php.

Referenced by findDeletedNodes(), and isDeleted().

◆ $mid

ilECSCmsData::$mid
private

Definition at line 21 of file class.ilECSCmsData.php.

Referenced by getMid().

◆ $obj_id

ilECSCmsData::$obj_id
private

Definition at line 19 of file class.ilECSCmsData.php.

Referenced by getObjId(), and lookupStatusByObjId().

◆ $server_id

ilECSCmsData::$server_id
private

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

Referenced by getServerId().

◆ $status

ilECSCmsData::$status = self::MAPPING_UNMAPPED
private

Definition at line 26 of file class.ilECSCmsData.php.

Referenced by getStatus(), writeAllStatus(), and writeStatus().

◆ $term

ilECSCmsData::$term
private

Definition at line 25 of file class.ilECSCmsData.php.

Referenced by getTerm().

◆ $title

ilECSCmsData::$title
private

Definition at line 24 of file class.ilECSCmsData.php.

Referenced by getTitle().

◆ $tree_id

ilECSCmsData::$tree_id
private

Definition at line 22 of file class.ilECSCmsData.php.

Referenced by getTreeId().

◆ MAPPING_DELETED

◆ MAPPING_MAPPED

const ilECSCmsData::MAPPING_MAPPED = 4

◆ MAPPING_PENDING_DISCONNECTABLE

const ilECSCmsData::MAPPING_PENDING_DISCONNECTABLE = 2

◆ MAPPING_PENDING_NOT_DISCONNECTABLE

const ilECSCmsData::MAPPING_PENDING_NOT_DISCONNECTABLE = 3

◆ MAPPING_UNMAPPED

const ilECSCmsData::MAPPING_UNMAPPED = 1

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