ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilECSCmsData Class Reference
+ Collaboration diagram for ilECSCmsData:

Public Member Functions

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

ilDBInterface $db
 
int $obj_id
 
int $server_id
 
int $mid
 
int $tree_id
 
string $cms_id
 
string $title
 
string $term
 
int $status = self::MAPPING_UNMAPPED
 
bool $deleted = false
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ __construct()

ilECSCmsData::__construct ( int  $a_obj_id = 0)

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

References $DIC, and read().

44  {
45  global $DIC;
46  $this->db = $DIC->database();
47 
48  $this->obj_id = $a_obj_id;
49  $this->read();
50  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilECSCmsData::delete ( )

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

References $query.

500  : void
501  {
502  $query = "DELETE FROM ecs_cms_data " .
503  'WHERE obj_id = ' . $this->db->quote($this->obj_id, 'integer');
504  $this->db->manipulate($query);
505  }
$query

◆ deleteByServerId()

static ilECSCmsData::deleteByServerId (   $a_server_id)
static

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

References $DIC, $ilDB, and $query.

Referenced by ilECSSetting\delete().

516  : void
517  {
518  global $DIC;
519 
520  $ilDB = $DIC['ilDB'];
521 
522  $query = "DELETE FROM ecs_cms_data " .
523  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer');
524  $ilDB->manipulate($query);
525  }
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ deleteTree()

ilECSCmsData::deleteTree ( )

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

References $query.

507  : void
508  {
509  $query = "DELETE FROM ecs_cms_data " .
510  'WHERE server_id = ' . $this->db->quote($this->server_id, 'integer') . ' ' .
511  'AND mid = ' . $this->db->quote($this->mid, 'integer') . ' ' .
512  'AND tree_id = ' . $this->db->quote($this->tree_id, 'integer') . ' ';
513  $this->db->manipulate($query);
514  }
$query

◆ findDeletedNodes()

static ilECSCmsData::findDeletedNodes ( int  $a_server_id,
int  $a_mid,
int  $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.

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

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

Referenced by ilECSCmsTreeCommandQueueHandler\handleUpdate().

75  : array
76  {
77  global $DIC;
78 
79  $ilDB = $DIC['ilDB'];
80 
81  $query = 'SELECT ed.obj_id obj_id FROM ecs_cms_data ed ' .
82  'LEFT JOIN ecs_cms_tree et ON ed.obj_id = et.child ' .
83  'WHERE et.child IS NULL ' .
84  'AND server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
85  'AND mid = ' . $ilDB->quote($a_mid) . ' ' .
86  'AND tree_id = ' . $ilDB->quote($a_tree_id);
87  $res = $ilDB->query($query);
88 
89  $deleted = array();
90  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
91  $deleted[] = $row->obj_id;
92  }
93  return $deleted;
94  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ getCmsId()

ilECSCmsData::getCmsId ( )

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

References $cms_id.

413  : string
414  {
415  return $this->cms_id;
416  }

◆ getMid()

ilECSCmsData::getMid ( )

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

References $mid.

443  : int
444  {
445  return $this->mid;
446  }

◆ getObjId()

ilECSCmsData::getObjId ( )

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

References $obj_id.

403  : int
404  {
405  return $this->obj_id;
406  }

◆ getServerId()

ilECSCmsData::getServerId ( )

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

References $server_id.

423  : int
424  {
425  return $this->server_id;
426  }

◆ getStatus()

ilECSCmsData::getStatus ( )

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

References $status.

453  : int
454  {
455  return $this->status;
456  }

◆ getTerm()

ilECSCmsData::getTerm ( )

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

References $term.

393  : string
394  {
395  return $this->term;
396  }

◆ getTitle()

ilECSCmsData::getTitle ( )

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

References $title.

Referenced by ilECSNodeMappingTreeTableGUI\parse().

383  : string
384  {
385  return $this->title;
386  }
+ Here is the caller graph for this function:

◆ getTreeId()

ilECSCmsData::getTreeId ( )

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

References $tree_id.

433  : int
434  {
435  return $this->tree_id;
436  }

◆ isDeleted()

ilECSCmsData::isDeleted ( )

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

References $deleted.

Referenced by update().

463  : bool
464  {
465  return $this->deleted;
466  }
+ Here is the caller graph for this function:

◆ lookupCmsId()

static ilECSCmsData::lookupCmsId (   $a_obj_id)
static

Lookup cms id.

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

Referenced by ilECSMappingSettingsGUI\dInitFormTreeSettings().

254  : string
255  {
256  $cms_ids = self::lookupCmsIds(array($a_obj_id));
257  return $cms_ids[0];
258  }
+ Here is the caller graph for this function:

◆ lookupCmsIds()

static ilECSCmsData::lookupCmsIds ( array  $a_obj_ids)
static
Parameters
int[]$a_obj_ids
Returns
string[]

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

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

Referenced by ilECSCourseCreationHandler\syncNodeToTop().

264  : array
265  {
266  global $DIC;
267 
268  $ilDB = $DIC['ilDB'];
269 
270  $query = 'SELECT cms_id FROM ecs_cms_data ' .
271  'WHERE ' . $ilDB->in('obj_id', $a_obj_ids, false, 'integer');
272  $res = $ilDB->query($query);
273 
274  $cms_ids = [];
275  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
276  $cms_ids[] = $row->cms_id;
277  }
278  return $cms_ids;
279  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ lookupCmsIdsOfTree()

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

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

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

Referenced by ilECSMappingSettingsGUI\dDeleteTree().

281  : array
282  {
283  global $DIC;
284 
285  $ilDB = $DIC['ilDB'];
286 
287  $query = 'SELECT cms_id FROM ecs_cms_data ' .
288  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
289  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
290  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer');
291  $res = $ilDB->query($query);
292  $cms_ids = array();
293  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
294  $cms_ids[] = $row->cms_id;
295  }
296  return $cms_ids;
297  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ 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.

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

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

Referenced by ilECSCourseCreationHandler\syncParentContainer().

121  : int
122  {
123  global $DIC;
124 
125  $ilDB = $DIC->database();
126  $logger = $DIC->logger()->wsrv();
127 
128  $logger->debug($a_server_id . ' ' . $a_mid . ' ' . $cms_id);
129 
130  $query = 'SELECT tree_id FROM ecs_cms_data ' .
131  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
132  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
133  'AND cms_id = ' . $ilDB->quote($cms_id, 'text') . ' ' .
134  'ORDER BY tree_id ';
135  $res = $ilDB->query($query);
136 
137  if ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
138  return $row->tree_id;
139  }
140  return 0;
141  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ lookupObjId()

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

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

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

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

96  : int
97  {
98  global $DIC;
99 
100  $ilDB = $DIC['ilDB'];
101  $logger = $DIC->logger()->wsrv();
102 
103  $query = 'SELECT obj_id FROM ecs_cms_data ' .
104  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
105  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
106  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
107  'AND cms_id = ' . $ilDB->quote($cms_id, 'text');
108  $res = $ilDB->query($query);
109 
110  $logger->debug($query);
111 
112  if ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
113  return $row->obj_id;
114  }
115  return 0;
116  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ lookupStatusByCmsId()

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

Lookup status.

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

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

Referenced by ilECSNodeMappingAssignments\deleteDisconnectableMappings().

213  : int
214  {
215  global $DIC;
216 
217  $ilDB = $DIC['ilDB'];
218 
219  $query = 'SELECT status FROM ecs_cms_data ' .
220  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
221  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
222  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
223  'AND cms_id = ' . $ilDB->quote($cms_id, 'text');
224  $res = $ilDB->query($query);
225  if ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
226  return (int) $row->status;
227  }
228  return self::MAPPING_UNMAPPED;
229  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ lookupStatusByObjId()

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

Lookup status.

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

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

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

189  : int
190  {
191  global $DIC;
192 
193  $ilDB = $DIC['ilDB'];
194 
195  $query = 'SELECT status,deleted FROM ecs_cms_data ' .
196  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
197  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
198  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
199  'AND obj_id = ' . $ilDB->quote($obj_id, 'integer');
200  $res = $ilDB->query($query);
201  if ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
202  if ($row->deleted) {
203  return self::MAPPING_DELETED;
204  }
205  return (int) $row->status;
206  }
207  return self::MAPPING_UNMAPPED;
208  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ lookupTitle()

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

Lookup title by obj id.

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

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

Referenced by ilECSMappingSettingsGUI\dConfirmDeleteTree().

146  : string
147  {
148  global $DIC;
149 
150  $ilDB = $DIC['ilDB'];
151 
152  $query = 'SELECT * FROM ecs_cms_data ' .
153  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
154  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
155  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer');
156  $res = $ilDB->query($query);
157  if ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
158  return $row->title;
159  }
160  return '';
161  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ lookupTopTerm()

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

Lookup term (highest term in cms tree)

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

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

Referenced by ilECSNodeMappingTreeTableGUI\parse().

166  : string
167  {
168  global $DIC;
169 
170  $ilDB = $DIC['ilDB'];
171 
172  $query = 'SELECT term FROM ecs_cms_data ' .
173  'JOIN ecs_cms_tree ON obj_id = child ' .
174  'WHERE tree = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
175  'AND server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
176  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
177  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
178  'ORDER BY depth';
179  $res = $ilDB->query($query);
180  if ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
181  return $row->term;
182  }
183  return '';
184  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ lookupTreeIds()

static ilECSCmsData::lookupTreeIds ( int  $a_server_id,
int  $a_mid 
)
static
Parameters
int$a_server_id
int$a_mid
Returns
int[]

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

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

Referenced by ilECSNodeMappingTreeTableGUI\parse().

359  : array
360  {
361  global $DIC;
362 
363  $ilDB = $DIC['ilDB'];
364 
365  $query = 'SELECT DISTINCT(tree_id) tid FROM ecs_cms_data ' .
366  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
367  'AND mid = ' . $ilDB->quote($a_mid, 'integer');
368  $res = $ilDB->query($query);
369 
370  $tree_ids = [];
371  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
372  $tree_ids[] = (int) $row->tid;
373  }
374  return $tree_ids;
375  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilECSCmsData::read ( )
protected

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

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

Referenced by __construct().

527  : void
528  {
529  $query = 'SELECT * FROM ecs_cms_data ' .
530  'WHERE obj_id = ' . $this->db->quote($this->obj_id, 'integer');
531  $res = $this->db->query($query);
532  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
533  $this->title = $row->title;
534  $this->term = $row->term;
535  $this->server_id = $row->server_id;
536  $this->mid = $row->mid;
537  $this->tree_id = $row->tree_id;
538  $this->cms_id = $row->cms_id;
539  $this->status = $row->status;
540  $this->deleted = $row->deleted;
541  }
542  }
$res
Definition: ltiservices.php:69
$query
+ Here is the caller graph for this function:

◆ save()

ilECSCmsData::save ( )

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

References $query.

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

◆ setCmsId()

ilECSCmsData::setCmsId (   $a_id)

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

408  : void
409  {
410  $this->cms_id = $a_id;
411  }

◆ setDeleted()

ilECSCmsData::setDeleted (   $a_is_deleted)

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

458  : void
459  {
460  $this->deleted = $a_is_deleted;
461  }

◆ setMid()

ilECSCmsData::setMid (   $a_id)

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

438  : void
439  {
440  $this->mid = $a_id;
441  }

◆ setObjId()

ilECSCmsData::setObjId (   $a_id)

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

398  : void
399  {
400  $this->obj_id = $a_id;
401  }

◆ setServerId()

ilECSCmsData::setServerId (   $a_id)

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

418  : void
419  {
420  $this->server_id = $a_id;
421  }

◆ setStatus()

ilECSCmsData::setStatus (   $a_status)

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

448  : void
449  {
450  $this->status = $a_status;
451  }

◆ setTerm()

ilECSCmsData::setTerm (   $a_term)

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

388  : void
389  {
390  $this->term = $a_term;
391  }

◆ setTitle()

ilECSCmsData::setTitle (   $a_title)

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

378  : void
379  {
380  $this->title = $a_title;
381  }

◆ setTreeId()

ilECSCmsData::setTreeId (   $a_id)

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

428  : void
429  {
430  $this->tree_id = $a_id;
431  }

◆ treeExists()

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

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

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

Referenced by ilECSTreeReader\read().

52  : bool
53  {
54  global $DIC;
55 
56  $ilDB = $DIC['ilDB'];
57 
58  $query = 'SELECT COUNT(*) num FROM ecs_cms_data ' .
59  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
60  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
61  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer');
62 
63  $res = $ilDB->query($query);
64  if ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
65  return $row->num > 0;
66  }
67  return false;
68  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ update()

ilECSCmsData::update ( )

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

References $query, and isDeleted().

489  : void
490  {
491  $query = "UPDATE ecs_cms_data SET " .
492  'title = ' . $this->db->quote($this->title, 'text') . ', ' .
493  'term = ' . $this->db->quote($this->term, 'text') . ', ' .
494  'status = ' . $this->db->quote($this->status, 'text') . ', ' .
495  'deleted = ' . $this->db->quote($this->isDeleted(), 'integer') . ' ' .
496  'WHERE obj_id = ' . $this->db->quote($this->obj_id, 'integer');
497  $this->db->manipulate($query);
498  }
$query
+ Here is the call graph for this function:

◆ updateStatus()

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

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

References ilECSNodeMappingAssignments\lookupAssignmentIds().

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

231  : void
232  {
233  // Set all status to pending unmapped
234  self::writeAllStatus($a_server_id, $a_mid, $a_tree_id, self::MAPPING_UNMAPPED);
235 
236  // Set mapped for mapped and their descendent
237  foreach (ilECSNodeMappingAssignments::lookupAssignmentIds($a_server_id, $a_mid, $a_tree_id) as $assignment) {
238  $cmsTree = new ilECSCmsTree($a_tree_id);
239  $subIds = self::lookupCmsIds(array_merge($cmsTree->getSubTreeIds($assignment), array($assignment)));
240 
241  self::writeStatus(
242  $a_server_id,
243  $a_mid,
244  $a_tree_id,
245  $subIds,
246  self::MAPPING_MAPPED
247  );
248  }
249  }
static lookupAssignmentIds(int $a_server_id, int $a_mid, int $a_tree_id)
Lookup assignments.
+ 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.

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

References $DIC, $ilDB, and $query.

Referenced by ilECSCmsTreeCommandQueueHandler\handleUpdate().

339  : bool
340  {
341  global $DIC;
342 
343  $ilDB = $DIC['ilDB'];
344 
345  $query = 'UPDATE ecs_cms_data ' .
346  'SET deleted = ' . $ilDB->quote($a_deleted_flag, 'integer') . ' ' .
347  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
348  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
349  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ';
350  $ilDB->manipulate($query);
351  return true;
352  }
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ writeAllStatus()

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

Update status.

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

References $DIC, $ilDB, and $query.

321  : bool
322  {
323  global $DIC;
324 
325  $ilDB = $DIC['ilDB'];
326 
327  $query = 'UPDATE ecs_cms_data ' .
328  'SET status = ' . $ilDB->quote($status, 'integer') . ' ' .
329  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
330  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
331  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ';
332  $ilDB->manipulate($query);
333  return true;
334  }
global $DIC
Definition: feed.php:28
$query

◆ writeStatus()

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

Update status.

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

References $DIC, $ilDB, and $query.

302  : bool
303  {
304  global $DIC;
305 
306  $ilDB = $DIC['ilDB'];
307 
308  $query = 'UPDATE ecs_cms_data ' .
309  'SET status = ' . $ilDB->quote($status, 'integer') . ' ' .
310  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
311  'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
312  'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
313  'AND ' . $ilDB->in('cms_id', $cms_ids, false, 'text');
314  $ilDB->manipulate($query);
315  return true;
316  }
global $DIC
Definition: feed.php:28
$query

Field Documentation

◆ $cms_id

string ilECSCmsData::$cms_id
private

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

Referenced by getCmsId().

◆ $db

ilDBInterface ilECSCmsData::$db
private

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

◆ $deleted

bool ilECSCmsData::$deleted = false
private

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

Referenced by findDeletedNodes(), and isDeleted().

◆ $mid

int ilECSCmsData::$mid
private

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

Referenced by getMid().

◆ $obj_id

int ilECSCmsData::$obj_id
private

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

Referenced by getObjId().

◆ $server_id

int ilECSCmsData::$server_id
private

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

Referenced by getServerId().

◆ $status

int ilECSCmsData::$status = self::MAPPING_UNMAPPED
private

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

Referenced by getStatus().

◆ $term

string ilECSCmsData::$term
private

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

Referenced by getTerm().

◆ $title

string ilECSCmsData::$title
private

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

Referenced by getTitle().

◆ $tree_id

int ilECSCmsData::$tree_id
private

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