ILIAS  release_7 Revision v7.30-3-g800a261c036
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 @global $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) @global <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)
 @global $ilDB $ilDB More...
 
static writeStatus ($a_server_id, $a_mid, $a_tree_id, $cms_ids, $status)
 Update status @global $ilDB. More...
 
static writeAllStatus ($a_server_id, $a_mid, $a_tree_id, $status)
 Update status @global $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.

29 {
30 $this->obj_id = $a_obj_id;
31 $this->read();
32 }

References read().

+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilECSCmsData::delete ( )

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

526 {
527 global $DIC;
528
529 $ilDB = $DIC['ilDB'];
530
531 $query = "DELETE FROM ecs_cms_data " .
532 'WHERE obj_id = ' . $ilDB->quote($this->obj_id, 'integer');
533 $ilDB->manipulate($query);
534 }
global $DIC
Definition: goto.php:24
$query
global $ilDB

References $DIC, $ilDB, and $query.

◆ deleteByServerId()

static ilECSCmsData::deleteByServerId (   $a_server_id)
static

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

550 {
551 global $DIC;
552
553 $ilDB = $DIC['ilDB'];
554
555 $query = "DELETE FROM ecs_cms_data " .
556 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer');
557 $ilDB->manipulate($query);
558 }

References $DIC, $ilDB, and $query.

Referenced by ilECSSetting\delete().

+ Here is the caller graph for this function:

◆ deleteTree()

ilECSCmsData::deleteTree ( )

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

537 {
538 global $DIC;
539
540 $ilDB = $DIC['ilDB'];
541
542 $query = "DELETE FROM ecs_cms_data " .
543 'WHERE server_id = ' . $ilDB->quote($this->server_id, 'integer') . ' ' .
544 'AND mid = ' . $ilDB->quote($this->mid, 'integer') . ' ' .
545 'AND tree_id = ' . $ilDB->quote($this->tree_id, 'integer') . ' ';
546 $ilDB->manipulate($query);
547 }

References $DIC, $ilDB, and $query.

◆ 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. @global $ilDB

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

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

63 {
64 global $DIC;
65
66 $ilDB = $DIC['ilDB'];
67
68 $query = 'SELECT ed.obj_id obj_id FROM ecs_cms_data ed ' .
69 'LEFT JOIN ecs_cms_tree et ON ed.obj_id = et.child ' .
70 'WHERE et.child IS NULL ' .
71 'AND server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
72 'AND mid = ' . $ilDB->quote($a_mid) . ' ' .
73 'AND tree_id = ' . $ilDB->quote($a_tree_id);
74 $res = $ilDB->query($query);
75
76 $deleted = array();
77 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
78 $deleted[] = $row->obj_id;
79 }
80 return $deleted;
81 }
foreach($_POST as $key=> $value) $res

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

Referenced by ilECSCmsTreeCommandQueueHandler\handleUpdate().

+ Here is the caller graph for this function:

◆ getCmsId()

ilECSCmsData::getCmsId ( )

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

431 {
432 return $this->cms_id;
433 }

References $cms_id.

◆ getMid()

ilECSCmsData::getMid ( )

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

461 {
462 return $this->mid;
463 }

References $mid.

◆ getObjId()

ilECSCmsData::getObjId ( )

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

421 {
422 return $this->obj_id;
423 }

References $obj_id.

◆ getServerId()

ilECSCmsData::getServerId ( )

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

441 {
442 return $this->server_id;
443 }

References $server_id.

◆ getStatus()

ilECSCmsData::getStatus ( )

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

471 {
472 return $this->status;
473 }

References $status.

◆ getTerm()

ilECSCmsData::getTerm ( )

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

411 {
412 return $this->term;
413 }

References $term.

◆ getTitle()

ilECSCmsData::getTitle ( )

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

401 {
402 return $this->title;
403 }

References $title.

◆ getTreeId()

ilECSCmsData::getTreeId ( )

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

451 {
452 return $this->tree_id;
453 }

References $tree_id.

◆ isDeleted()

ilECSCmsData::isDeleted ( )

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

481 {
482 return $this->deleted;
483 }

References $deleted.

Referenced by update().

+ 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 254 of file class.ilECSCmsData.php.

255 {
256 $cms_ids = self::lookupCmsIds(array($a_obj_id));
257 return $cms_ids[0];
258 }
static lookupCmsIds($a_obj_ids)

References lookupCmsIds().

Referenced by ilECSMappingSettingsGUI\dInitFormTreeSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupCmsIds()

static ilECSCmsData::lookupCmsIds (   $a_obj_ids)
static

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

262 {
263 global $DIC;
264
265 $ilDB = $DIC['ilDB'];
266
267 $query = 'SELECT cms_id FROM ecs_cms_data ' .
268 'WHERE ' . $ilDB->in('obj_id', $a_obj_ids, false, 'integer');
269 $res = $ilDB->query($query);
270
271 $cms_ids = array();
272 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
273 $cms_ids[] = $row->cms_id;
274 }
275 return $cms_ids;
276 }

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

Referenced by lookupCmsId(), ilECSCourseCreationHandler\syncNodeToTop(), and updateStatus().

+ Here is the caller graph for this function:

◆ lookupCmsIdsOfTree()

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

@global $ilDB $ilDB

Parameters
type$a_server_id
type$a_mid
type$a_tree_id

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

286 {
287 global $DIC;
288
289 $ilDB = $DIC['ilDB'];
290
291 $query = 'SELECT cms_id FROM ecs_cms_data ' .
292 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
293 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
294 'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer');
295 $res = $ilDB->query($query);
296 $cms_ids = array();
297 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
298 $cms_ids[] = $row->cms_id;
299 }
300 return $cms_ids;
301 }

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

Referenced by ilECSMappingSettingsGUI\dDeleteTree().

+ 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 @global $ilDB $ilDB.

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

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

113 {
114 global $DIC;
115
116 $ilDB = $DIC['ilDB'];
117
118 $GLOBALS['DIC']['ilLog']->write(__METHOD__ . ':ASDUASDUASDU ' . $a_server_id . ' ' . $a_mid . ' ' . $cms_id);
119
120 $query = 'SELECT tree_id FROM ecs_cms_data ' .
121 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
122 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
123 'AND cms_id = ' . $ilDB->quote($cms_id, 'text') . ' ' .
124 'ORDER BY tree_id ';
125 $res = $ilDB->query($query);
126
127 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
128 return $row->tree_id;
129 }
130 return 0;
131 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64

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

Referenced by ilECSCourseCreationHandler\syncParentContainer().

+ 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 83 of file class.ilECSCmsData.php.

84 {
85 global $DIC;
86
87 $ilDB = $DIC['ilDB'];
88
89 $query = 'SELECT obj_id FROM ecs_cms_data ' .
90 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
91 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
92 'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
93 'AND cms_id = ' . $ilDB->quote($cms_id, 'text');
94 $res = $ilDB->query($query);
95
96 $GLOBALS['DIC']['ilLog']->write(__METHOD__ . ': ' . $query);
97
98 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
99 return $row->obj_id;
100 }
101 return 0;
102 }

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

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

+ 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 210 of file class.ilECSCmsData.php.

211 {
212 global $DIC;
213
214 $ilDB = $DIC['ilDB'];
215
216 $query = 'SELECT status FROM ecs_cms_data ' .
217 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
218 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
219 'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
220 'AND cms_id = ' . $ilDB->quote($cms_id, 'text');
221 $res = $ilDB->query($query);
222 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
223 return $row->status;
224 }
226 }

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

Referenced by ilECSNodeMappingAssignments\deleteDisconnectableMappings().

+ 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 185 of file class.ilECSCmsData.php.

186 {
187 global $DIC;
188
189 $ilDB = $DIC['ilDB'];
190
191 $query = 'SELECT status,deleted FROM ecs_cms_data ' .
192 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
193 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
194 'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
195 'AND obj_id = ' . $ilDB->quote($obj_id, 'integer');
196 $res = $ilDB->query($query);
197 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
198 if ($row->deleted) {
200 }
201 return $row->status;
202 }
204 }

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

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

+ 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 137 of file class.ilECSCmsData.php.

138 {
139 global $DIC;
140
141 $ilDB = $DIC['ilDB'];
142
143 $query = 'SELECT * FROM ecs_cms_data ' .
144 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
145 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
146 'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer');
147 $res = $ilDB->query($query);
148 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
149 return $row->title;
150 }
151 return '';
152 }

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

Referenced by ilECSMappingSettingsGUI\dConfirmDeleteTree().

+ 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) @global <type> $ilDB.

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

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

162 {
163 global $DIC;
164
165 $ilDB = $DIC['ilDB'];
166
167 $query = 'SELECT term FROM ecs_cms_data ' .
168 'JOIN ecs_cms_tree ON obj_id = child ' .
169 'WHERE tree = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
170 'AND server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
171 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
172 'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
173 'ORDER BY depth';
174 $res = $ilDB->query($query);
175 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
176 return $row->term;
177 }
178 return '';
179 }

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

Referenced by ilECSNodeMappingTreeTableGUI\parse().

+ Here is the caller graph for this function:

◆ lookupTreeIds()

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

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

377 {
378 global $DIC;
379
380 $ilDB = $DIC['ilDB'];
381
382 $query = 'SELECT DISTINCT(tree_id) tid FROM ecs_cms_data ' .
383 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
384 'AND mid = ' . $ilDB->quote($a_mid, 'integer');
385 $res = $ilDB->query($query);
386
387 $tree_ids = array();
388 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
389 $tree_ids[] = $row->tid;
390 }
391 return (array) $tree_ids;
392 }

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

Referenced by ilECSNodeMappingTreeTableGUI\parse().

+ Here is the caller graph for this function:

◆ read()

ilECSCmsData::read ( )
protected

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

561 {
562 global $DIC;
563
564 $ilDB = $DIC['ilDB'];
565
566 $query = 'SELECT * FROM ecs_cms_data ' .
567 'WHERE obj_id = ' . $ilDB->quote($this->obj_id, 'integer');
568 $res = $ilDB->query($query);
569 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
570 $this->title = $row->title;
571 $this->term = $row->term;
572 $this->server_id = $row->server_id;
573 $this->mid = $row->mid;
574 $this->tree_id = $row->tree_id;
575 $this->cms_id = $row->cms_id;
576 $this->status = $row->status;
577 $this->deleted = $row->deleted;
578 }
579 }

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

Referenced by __construct().

+ Here is the caller graph for this function:

◆ save()

ilECSCmsData::save ( )

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

487 {
488 global $DIC;
489
490 $ilDB = $DIC['ilDB'];
491
492 $this->obj_id = $ilDB->nextId('ecs_cms_data');
493
494 $query = 'INSERT INTO ecs_cms_data (obj_id,server_id,mid,tree_id,cms_id,title,term,status,deleted) ' .
495 'VALUES ( ' .
496 $ilDB->quote($this->obj_id, 'integer') . ', ' .
497 $ilDB->quote($this->server_id, 'integer') . ', ' .
498 $ilDB->quote($this->mid, 'integer') . ', ' .
499 $ilDB->quote($this->tree_id, 'integer') . ', ' .
500 $ilDB->quote($this->cms_id, 'text') . ', ' .
501 $ilDB->quote($this->title, 'text') . ', ' .
502 $ilDB->quote($this->term, 'text') . ', ' .
503 $ilDB->quote($this->status, 'integer') . ', ' .
504 $ilDB->quote($this->deleted, 'integer') . ' ' .
505 ')';
506 $ilDB->manipulate($query);
507 return true;
508 }

References $DIC, $ilDB, and $query.

◆ setCmsId()

ilECSCmsData::setCmsId (   $a_id)

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

426 {
427 $this->cms_id = $a_id;
428 }

◆ setDeleted()

ilECSCmsData::setDeleted (   $a_is_deleted)

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

476 {
477 $this->deleted = $a_is_deleted;
478 }

◆ setMid()

ilECSCmsData::setMid (   $a_id)

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

456 {
457 $this->mid = $a_id;
458 }

◆ setObjId()

ilECSCmsData::setObjId (   $a_id)

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

416 {
417 $this->obj_id = $a_id;
418 }

◆ setServerId()

ilECSCmsData::setServerId (   $a_id)

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

436 {
437 $this->server_id = $a_id;
438 }

◆ setStatus()

ilECSCmsData::setStatus (   $a_status)

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

466 {
467 $this->status = $a_status;
468 }

◆ setTerm()

ilECSCmsData::setTerm (   $a_term)

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

406 {
407 $this->term = $a_term;
408 }

◆ setTitle()

ilECSCmsData::setTitle (   $a_title)

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

396 {
397 $this->title = $a_title;
398 }

◆ setTreeId()

ilECSCmsData::setTreeId (   $a_id)

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

446 {
447 $this->tree_id = $a_id;
448 }

◆ treeExists()

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

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

35 {
36 global $DIC;
37
38 $ilDB = $DIC['ilDB'];
39
40 $query = 'SELECT COUNT(*) num FROM ecs_cms_data ' .
41 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
42 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
43 'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer');
44
45 $res = $ilDB->query($query);
46 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
47 return $row->num > 0 ? true : false;
48 }
49 return false;
50 }
return true
Flag indicating whether or not HTTP headers will be sent when outputting captcha image/audio.

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

Referenced by ilECSTreeReader\read().

+ Here is the caller graph for this function:

◆ update()

ilECSCmsData::update ( )

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

511 {
512 global $DIC;
513
514 $ilDB = $DIC['ilDB'];
515
516 $query = "UPDATE ecs_cms_data SET " .
517 'title = ' . $ilDB->quote($this->title, 'text') . ', ' .
518 'term = ' . $ilDB->quote($this->term, 'text') . ', ' .
519 'status = ' . $ilDB->quote($this->status, 'text') . ', ' .
520 'deleted = ' . $ilDB->quote($this->isDeleted(), 'integer') . ' ' .
521 'WHERE obj_id = ' . $ilDB->quote($this->obj_id, 'integer');
522 $ilDB->manipulate($query);
523 }

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

+ Here is the call graph for this function:

◆ updateStatus()

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

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

229 {
230 // Set all status to pending unmapped
231 self::writeAllStatus($a_server_id, $a_mid, $a_tree_id, self::MAPPING_UNMAPPED);
232
233 // Set mapped for mapped and their descendent
234 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
235 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
236 foreach (ilECSNodeMappingAssignments::lookupAssignmentIds($a_server_id, $a_mid, $a_tree_id) as $assignment) {
237 $cmsTree = new ilECSCmsTree($a_tree_id);
238 $subIds = self::lookupCmsIds(array_merge($cmsTree->getSubTreeIds($assignment), array($assignment)));
239
241 $a_server_id,
242 $a_mid,
243 $a_tree_id,
244 $subIds,
245 self::MAPPING_MAPPED
246 );
247 }
248 }
static writeAllStatus($a_server_id, $a_mid, $a_tree_id, $status)
Update status @global $ilDB.
static writeStatus($a_server_id, $a_mid, $a_tree_id, $cms_ids, $status)
Update status @global $ilDB.
static lookupAssignmentIds($a_server_id, $a_mid, $a_tree_id)
Lookup assignments @global $ilDB.

References ilECSNodeMappingAssignments\lookupAssignmentIds(), lookupCmsIds(), writeAllStatus(), and writeStatus().

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

+ 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 361 of file class.ilECSCmsData.php.

362 {
363 global $DIC;
364
365 $ilDB = $DIC['ilDB'];
366
367 $query = 'UPDATE ecs_cms_data ' .
368 'SET deleted = ' . $ilDB->quote($a_deleted_flag, 'integer') . ' ' .
369 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
370 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
371 'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ';
372 $ilDB->manipulate($query);
373 return true;
374 }

References $DIC, $ilDB, and $query.

Referenced by ilECSCmsTreeCommandQueueHandler\handleUpdate().

+ Here is the caller graph for this function:

◆ writeAllStatus()

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

Update status @global $ilDB.

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

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

340 {
341 global $DIC;
342
343 $ilDB = $DIC['ilDB'];
344
345 $query = 'UPDATE ecs_cms_data ' .
346 'SET status = ' . $ilDB->quote($status, '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 }

References $DIC, $ilDB, $query, and $status.

Referenced by updateStatus().

+ Here is the caller graph for this function:

◆ writeStatus()

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

Update status @global $ilDB.

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

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

314 {
315 global $DIC;
316
317 $ilDB = $DIC['ilDB'];
318
319 $query = 'UPDATE ecs_cms_data ' .
320 'SET status = ' . $ilDB->quote($status, 'integer') . ' ' .
321 'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
322 'AND mid = ' . $ilDB->quote($a_mid, 'integer') . ' ' .
323 'AND tree_id = ' . $ilDB->quote($a_tree_id, 'integer') . ' ' .
324 'AND ' . $ilDB->in('cms_id', $cms_ids, false, 'text');
325 $ilDB->manipulate($query);
326 return true;
327 }

References $DIC, $ilDB, $query, and $status.

Referenced by updateStatus().

+ Here is the caller graph for this function:

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


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