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

References read().

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

Member Function Documentation

◆ delete()

ilECSCmsData::delete ( )

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

References $ilDB, and $query.

494  {
495  global $ilDB;
496 
497  $query = "DELETE FROM ecs_cms_data " .
498  'WHERE obj_id = ' . $ilDB->quote($this->obj_id, 'integer');
499  $ilDB->manipulate($query);
500  }
$query
global $ilDB

◆ deleteByServerId()

static ilECSCmsData::deleteByServerId (   $a_server_id)
static

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

References $ilDB, and $query.

Referenced by ilECSSetting\delete().

514  {
515  global $ilDB;
516 
517  $query = "DELETE FROM ecs_cms_data " .
518  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer');
519  $ilDB->manipulate($query);
520  }
$query
global $ilDB
+ Here is the caller graph for this function:

◆ deleteTree()

ilECSCmsData::deleteTree ( )

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

References $ilDB, and $query.

503  {
504  global $ilDB;
505 
506  $query = "DELETE FROM ecs_cms_data " .
507  'WHERE server_id = ' . $ilDB->quote($this->server_id, 'integer') . ' ' .
508  'AND mid = ' . $ilDB->quote($this->mid, 'integer') . ' ' .
509  'AND tree_id = ' . $ilDB->quote($this->tree_id, 'integer') . ' ';
510  $ilDB->manipulate($query);
511  }
$query
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 60 of file class.ilECSCmsData.php.

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

Referenced by ilECSCmsTreeCommandQueueHandler\handleUpdate().

61  {
62  global $ilDB;
63 
64  $query = 'SELECT ed.obj_id obj_id FROM ecs_cms_data ed ' .
65  'LEFT JOIN ecs_cms_tree et ON ed.obj_id = et.child ' .
66  'WHERE et.child IS NULL ' .
67  'AND server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
68  'AND mid = ' . $ilDB->quote($a_mid) . ' ' .
69  'AND tree_id = ' . $ilDB->quote($a_tree_id);
70  $res = $ilDB->query($query);
71 
72  $deleted = array();
73  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
74  $deleted[] = $row->obj_id;
75  }
76  return $deleted;
77  }
foreach($_POST as $key=> $value) $res
$query
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 402 of file class.ilECSCmsData.php.

References $cms_id.

403  {
404  return $this->cms_id;
405  }

◆ getMid()

ilECSCmsData::getMid ( )

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

References $mid.

433  {
434  return $this->mid;
435  }

◆ getObjId()

ilECSCmsData::getObjId ( )

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

References $obj_id.

393  {
394  return $this->obj_id;
395  }

◆ getServerId()

ilECSCmsData::getServerId ( )

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

References $server_id.

413  {
414  return $this->server_id;
415  }

◆ getStatus()

ilECSCmsData::getStatus ( )

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

References $status.

443  {
444  return $this->status;
445  }

◆ getTerm()

ilECSCmsData::getTerm ( )

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

References $term.

383  {
384  return $this->term;
385  }

◆ getTitle()

ilECSCmsData::getTitle ( )

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

References $title.

Referenced by ilECSNodeMappingTreeTableGUI\parse().

373  {
374  return $this->title;
375  }
+ Here is the caller graph for this function:

◆ getTreeId()

ilECSCmsData::getTreeId ( )

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

References $tree_id.

423  {
424  return $this->tree_id;
425  }

◆ isDeleted()

ilECSCmsData::isDeleted ( )

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

References $deleted.

Referenced by update().

453  {
454  return $this->deleted;
455  }
+ 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 238 of file class.ilECSCmsData.php.

References array.

Referenced by ilECSMappingSettingsGUI\dInitFormTreeSettings().

239  {
240  $cms_ids = self::lookupCmsIds(array($a_obj_id));
241  return $cms_ids[0];
242  }
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 245 of file class.ilECSCmsData.php.

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

Referenced by ilECSCourseCreationHandler\syncNodeToTop().

246  {
247  global $ilDB;
248 
249  $query = 'SELECT cms_id FROM ecs_cms_data ' .
250  'WHERE ' . $ilDB->in('obj_id', $a_obj_ids, false, 'integer');
251  $res = $ilDB->query($query);
252 
253  $cms_ids = array();
254  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
255  $cms_ids[] = $row->cms_id;
256  }
257  return $cms_ids;
258  }
foreach($_POST as $key=> $value) $res
$query
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 267 of file class.ilECSCmsData.php.

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

Referenced by ilECSMappingSettingsGUI\dDeleteTree().

268  {
269  global $ilDB;
270 
271  $query = 'SELECT cms_id FROM ecs_cms_data ' .
272  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
273  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
274  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer');
275  $res = $ilDB->query($query);
276  $cms_ids = array();
277  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
278  $cms_ids[] = $row->cms_id;
279  }
280  return $cms_ids;
281  }
foreach($_POST as $key=> $value) $res
$query
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 106 of file class.ilECSCmsData.php.

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

Referenced by ilECSCourseCreationHandler\syncParentContainer().

107  {
108  global $ilDB;
109 
110  $GLOBALS['ilLog']->write(__METHOD__ . ':ASDUASDUASDU ' . $a_server_id . ' ' . $a_mid . ' ' . $cms_id);
111 
112  $query = 'SELECT tree_id FROM ecs_cms_data ' .
113  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
114  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
115  'AND cms_id = ' . $ilDB->quote($cms_id, 'text') . ' ' .
116  'ORDER BY tree_id ';
117  $res = $ilDB->query($query);
118 
119  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
120  return $row->tree_id;
121  }
122  return 0;
123  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
foreach($_POST as $key=> $value) $res
$query
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 79 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().

80  {
81  global $ilDB;
82 
83  $query = 'SELECT obj_id FROM ecs_cms_data ' .
84  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
85  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
86  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
87  'AND cms_id = ' . $ilDB->quote($cms_id, 'text');
88  $res = $ilDB->query($query);
89 
90  $GLOBALS['ilLog']->write(__METHOD__ . ': ' . $query);
91 
92  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
93  return $row->obj_id;
94  }
95  return 0;
96  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
foreach($_POST as $key=> $value) $res
$query
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 196 of file class.ilECSCmsData.php.

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

Referenced by ilECSNodeMappingAssignments\deleteDisconnectableMappings().

197  {
198  global $ilDB;
199 
200  $query = 'SELECT status FROM ecs_cms_data ' .
201  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
202  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
203  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
204  'AND cms_id = ' . $ilDB->quote($cms_id, 'text');
205  $res = $ilDB->query($query);
206  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
207  return $row->status;
208  }
209  return self::MAPPING_UNMAPPED;
210  }
foreach($_POST as $key=> $value) $res
$query
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 173 of file class.ilECSCmsData.php.

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

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

174  {
175  global $ilDB;
176 
177  $query = 'SELECT status,deleted FROM ecs_cms_data ' .
178  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
179  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
180  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
181  'AND obj_id = ' . $ilDB->quote($obj_id, 'integer');
182  $res = $ilDB->query($query);
183  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
184  if ($row->deleted) {
185  return self::MAPPING_DELETED;
186  }
187  return $row->status;
188  }
189  return self::MAPPING_UNMAPPED;
190  }
foreach($_POST as $key=> $value) $res
$query
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 129 of file class.ilECSCmsData.php.

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

Referenced by ilECSMappingSettingsGUI\dConfirmDeleteTree().

130  {
131  global $ilDB;
132 
133  $query = 'SELECT * FROM ecs_cms_data ' .
134  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
135  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
136  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer');
137  $res = $ilDB->query($query);
138  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
139  return $row->title;
140  }
141  return '';
142  }
foreach($_POST as $key=> $value) $res
$query
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 151 of file class.ilECSCmsData.php.

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

Referenced by ilECSNodeMappingTreeTableGUI\parse().

152  {
153  global $ilDB;
154 
155  $query = 'SELECT term FROM ecs_cms_data ' .
156  'JOIN ecs_cms_tree ON obj_id = child ' .
157  'WHERE tree = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
158  'AND server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
159  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
160  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
161  'ORDER BY depth';
162  $res = $ilDB->query($query);
163  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
164  return $row->term;
165  }
166  return '';
167  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ lookupTreeIds()

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

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

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

Referenced by ilECSNodeMappingTreeTableGUI\parse().

351  {
352  global $ilDB;
353 
354  $query = 'SELECT DISTINCT(tree_id) tid FROM ecs_cms_data ' .
355  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
356  'AND mid = ' . $ilDB->quote($a_mid, 'integer');
357  $res = $ilDB->query($query);
358 
359  $tree_ids = array();
360  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
361  $tree_ids[] = $row->tid;
362  }
363  return (array) $tree_ids;
364  }
foreach($_POST as $key=> $value) $res
$query
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 522 of file class.ilECSCmsData.php.

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

Referenced by __construct().

523  {
524  global $ilDB;
525 
526  $query = 'SELECT * FROM ecs_cms_data ' .
527  'WHERE obj_id = ' . $ilDB->quote($this->obj_id, 'integer');
528  $res = $ilDB->query($query);
529  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
530  $this->title = $row->title;
531  $this->term = $row->term;
532  $this->server_id = $row->server_id;
533  $this->mid = $row->mid;
534  $this->tree_id = $row->tree_id;
535  $this->cms_id = $row->cms_id;
536  $this->status = $row->status;
537  $this->deleted = $row->deleted;
538  }
539  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ save()

ilECSCmsData::save ( )

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

References $ilDB, and $query.

459  {
460  global $ilDB;
461 
462  $this->obj_id = $ilDB->nextId('ecs_cms_data');
463 
464  $query = 'INSERT INTO ecs_cms_data (obj_id,server_id,mid,tree_id,cms_id,title,term,status,deleted) ' .
465  'VALUES ( ' .
466  $ilDB->quote($this->obj_id, 'integer') . ', ' .
467  $ilDB->quote($this->server_id, 'integer') . ', ' .
468  $ilDB->quote($this->mid, 'integer') . ', ' .
469  $ilDB->quote($this->tree_id, 'integer') . ', ' .
470  $ilDB->quote($this->cms_id, 'text') . ', ' .
471  $ilDB->quote($this->title, 'text') . ', ' .
472  $ilDB->quote($this->term, 'text') . ', ' .
473  $ilDB->quote($this->status, 'integer') . ', ' .
474  $ilDB->quote($this->deleted, 'integer') . ' ' .
475  ')';
476  $ilDB->manipulate($query);
477  return true;
478  }
$query
global $ilDB

◆ setCmsId()

ilECSCmsData::setCmsId (   $a_id)

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

398  {
399  $this->cms_id = $a_id;
400  }

◆ setDeleted()

ilECSCmsData::setDeleted (   $a_is_deleted)

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

448  {
449  $this->deleted = $a_is_deleted;
450  }

◆ setMid()

ilECSCmsData::setMid (   $a_id)

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

428  {
429  $this->mid = $a_id;
430  }

◆ setObjId()

ilECSCmsData::setObjId (   $a_id)

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

388  {
389  $this->obj_id = $a_id;
390  }

◆ setServerId()

ilECSCmsData::setServerId (   $a_id)

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

408  {
409  $this->server_id = $a_id;
410  }

◆ setStatus()

ilECSCmsData::setStatus (   $a_status)

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

438  {
439  $this->status = $a_status;
440  }

◆ setTerm()

ilECSCmsData::setTerm (   $a_term)

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

378  {
379  $this->term = $a_term;
380  }

◆ setTitle()

ilECSCmsData::setTitle (   $a_title)

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

368  {
369  $this->title = $a_title;
370  }

◆ setTreeId()

ilECSCmsData::setTreeId (   $a_id)

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

418  {
419  $this->tree_id = $a_id;
420  }

◆ treeExists()

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

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

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

Referenced by ilECSTreeReader\read().

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

◆ update()

ilECSCmsData::update ( )

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

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

481  {
482  global $ilDB;
483 
484  $query = "UPDATE ecs_cms_data SET " .
485  'title = ' . $ilDB->quote($this->title, 'text') . ', ' .
486  'term = ' . $ilDB->quote($this->term, 'text') . ', ' .
487  'status = ' . $ilDB->quote($this->status, 'text') . ', ' .
488  'deleted = ' . $ilDB->quote($this->isDeleted(), 'integer') . ' ' .
489  'WHERE obj_id = ' . $ilDB->quote($this->obj_id, 'integer');
490  $ilDB->manipulate($query);
491  }
$query
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 212 of file class.ilECSCmsData.php.

References array, and ilECSNodeMappingAssignments\lookupAssignmentIds().

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

213  {
214  // Set all status to pending unmapped
215  self::writeAllStatus($a_server_id, $a_mid, $a_tree_id, self::MAPPING_UNMAPPED);
216 
217  // Set mapped for mapped and their descendent
218  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
219  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
220  foreach (ilECSNodeMappingAssignments::lookupAssignmentIds($a_server_id, $a_mid, $a_tree_id) as $assignment) {
221  $cmsTree = new ilECSCmsTree($a_tree_id);
222  $subIds = self::lookupCmsIds(array_merge($cmsTree->getSubTreeIds($assignment), array($assignment)));
223 
224  self::writeStatus(
225  $a_server_id,
226  $a_mid,
227  $a_tree_id,
228  $subIds,
229  self::MAPPING_MAPPED
230  );
231  }
232  }
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 337 of file class.ilECSCmsData.php.

References $ilDB, and $query.

Referenced by ilECSCmsTreeCommandQueueHandler\handleUpdate().

338  {
339  global $ilDB;
340 
341  $query = 'UPDATE ecs_cms_data ' .
342  'SET deleted = ' . $ilDB->quote($a_deleted_flag, 'integer') . ' ' .
343  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
344  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
345  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ';
346  $ilDB->manipulate($query);
347  return true;
348  }
$query
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 317 of file class.ilECSCmsData.php.

References $ilDB, $query, and $status.

318  {
319  global $ilDB;
320 
321  $query = 'UPDATE ecs_cms_data ' .
322  'SET status = ' . $ilDB->quote($status, 'integer') . ' ' .
323  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
324  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
325  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ';
326  $ilDB->manipulate($query);
327  return true;
328  }
$query
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 293 of file class.ilECSCmsData.php.

References $ilDB, $query, and $status.

294  {
295  global $ilDB;
296 
297  $query = 'UPDATE ecs_cms_data ' .
298  'SET status = ' . $ilDB->quote($status, 'integer') . ' ' .
299  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
300  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
301  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
302  'AND ' . $ilDB->in('cms_id', $cms_ids, false, 'text');
303  $ilDB->manipulate($query);
304  return true;
305  }
$query
global $ilDB

Field Documentation

◆ $cms_id

ilECSCmsData::$cms_id
private

◆ $deleted

ilECSCmsData::$deleted = false
private

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

Referenced by findDeletedNodes(), and isDeleted().

◆ $mid

ilECSCmsData::$mid
private

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

Referenced by getMid().

◆ $obj_id

ilECSCmsData::$obj_id
private

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

Referenced by getObjId(), and lookupStatusByObjId().

◆ $server_id

ilECSCmsData::$server_id
private

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

Referenced by getServerId().

◆ $status

ilECSCmsData::$status = self::MAPPING_UNMAPPED
private

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

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

◆ $term

ilECSCmsData::$term
private

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

Referenced by getTerm().

◆ $title

ilECSCmsData::$title
private

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

Referenced by getTitle().

◆ $tree_id

ilECSCmsData::$tree_id
private

Definition at line 21 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: