ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
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.

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

References $DIC, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilECSCmsData::delete ( )

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

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

References $query.

◆ deleteByServerId()

static ilECSCmsData::deleteByServerId (   $a_server_id)
static

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

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 }

References $DIC, $ilDB, and $query.

Referenced by ilECSSetting\delete().

+ Here is the caller graph for this function:

◆ deleteTree()

ilECSCmsData::deleteTree ( )

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

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 }

References $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.

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

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

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

References $cms_id.

◆ getMid()

ilECSCmsData::getMid ( )

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

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

References $mid.

◆ getObjId()

ilECSCmsData::getObjId ( )

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

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

References $obj_id.

◆ getServerId()

ilECSCmsData::getServerId ( )

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

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

References $server_id.

◆ getStatus()

ilECSCmsData::getStatus ( )

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

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

References $status.

◆ getTerm()

ilECSCmsData::getTerm ( )

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

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

References $term.

◆ getTitle()

ilECSCmsData::getTitle ( )

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

383 : string
384 {
385 return $this->title;
386 }

References $title.

◆ getTreeId()

ilECSCmsData::getTreeId ( )

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

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

References $tree_id.

◆ isDeleted()

ilECSCmsData::isDeleted ( )

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

463 : bool
464 {
465 return $this->deleted;
466 }

References $deleted.

Referenced by update().

+ 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.

254 : string
255 {
256 $cms_ids = self::lookupCmsIds(array($a_obj_id));
257 return $cms_ids[0];
258 }
static lookupCmsIds(array $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 ( array  $a_obj_ids)
static
Parameters
int[]$a_obj_ids
Returns
string[]

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

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 }

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

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

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 }

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.

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

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 }

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

Referenced by ilECSCourseCreationHandler\syncParentContainer().

+ 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.

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 }

References $cms_id, $DIC, $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 ( 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.

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 }
229 }

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 ( 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.

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) {
204 }
205 return (int) $row->status;
206 }
208 }

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 ( 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.

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 }

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 ( 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.

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 }

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 ( 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.

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 }

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

Referenced by ilECSNodeMappingTreeTableGUI\parse().

+ 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.

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 }

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

Referenced by __construct().

+ Here is the caller graph for this function:

◆ save()

ilECSCmsData::save ( )

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

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 }

References $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.

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 }

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

Referenced by ilECSTreeReader\read().

+ Here is the caller graph for this function:

◆ update()

ilECSCmsData::update ( )

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

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 }

References $query, and isDeleted().

+ 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.

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
242 $a_server_id,
243 $a_mid,
244 $a_tree_id,
245 $subIds,
246 self::MAPPING_MAPPED
247 );
248 }
249 }
static writeAllStatus($a_server_id, $a_mid, $a_tree_id, $status)
Update status.
static writeStatus($a_server_id, $a_mid, $a_tree_id, $cms_ids, $status)
Update status.
static lookupAssignmentIds(int $a_server_id, int $a_mid, int $a_tree_id)
Lookup assignments.

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.

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

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 }

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.

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

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 }

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.

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

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 }

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

Referenced by updateStatus().

+ Here is the caller graph for this function:

Field Documentation

◆ $cms_id

string ilECSCmsData::$cms_id
private

◆ $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(), and lookupStatusByObjId().

◆ $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(), writeAllStatus(), and writeStatus().

◆ $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


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