ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.ilECSCmsTree.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
include_once
'./Services/Tree/classes/class.ilTree.php'
;
5
12
class
ilECSCmsTree
extends
ilTree
13
{
14
public
function
__construct
($a_tree_id)
15
{
16
parent::__construct($a_tree_id, self::lookupRootId($a_tree_id));
17
18
$this->
setObjectTablePK
(
'obj_id'
);
19
$this->
setTableNames
(
'ecs_cms_tree'
,
'ecs_cms_data'
);
20
$this->
useCache
(
false
);
21
}
22
23
public
function
insertRootNode
($tree, $a_child)
24
{
25
global
$ilDB
;
26
27
$query
=
'INSERT INTO ecs_cms_tree '
.
28
'(tree,child,parent,lft,rgt,depth) '
.
29
'VALUES ( '
.
30
$ilDB
->quote($tree,
'integer'
) .
', '
.
31
$ilDB
->quote($a_child,
'integer'
) .
', '
.
32
$ilDB
->quote(0,
'integer'
) .
', '
.
33
$ilDB
->quote(1,
'integer'
) .
', '
.
34
$ilDB
->quote(100,
'integer'
) .
', '
.
35
$ilDB
->quote(1,
'integer'
) .
' )'
;
36
37
$ilDB
->manipulate(
$query
);
38
39
40
return
true
;
41
}
42
46
public
static
function
deleteByTreeId
($a_tree_id)
47
{
48
global
$ilDB
;
49
50
$GLOBALS
[
'DIC'
]->logger()->wsrv()->debug(
'Deleting cms tree: '
. $a_tree_id);
51
$query
=
'DELETE FROM ecs_cms_tree '
.
52
'WHERE tree = '
.
$ilDB
->quote($a_tree_id,
'integer'
);
53
$ilDB
->manipulate(
$query
);
54
return
true
;
55
}
56
61
public
function
treeExists
($a_tree_id)
62
{
63
global
$ilDB
;
64
65
$query
=
'SELECT COUNT(*) num FROM ecs_cms_tree WHERE tree = '
.
$ilDB
->quote($a_tree_id,
'integer'
);
66
$res
=
$ilDB
->query(
$query
);
67
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
68
return
$row
->num > 0 ? true :
false
;
69
}
70
return
false
;
71
}
72
73
77
public
static
function
lookupRootId
($a_tree_id)
78
{
79
global
$ilDB
;
80
81
$query
=
'SELECT child FROM ecs_cms_tree WHERE tree = '
.
$ilDB
->quote($a_tree_id,
'integer'
);
82
$res
=
$ilDB
->query(
$query
);
83
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
84
return
$row
->child;
85
}
86
return
0;
87
}
88
}
$row
$row
Definition:
10autofilter-selection-1.php:74
php
An exception for terminatinating execution or to throw for unit testing.
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilECSCmsTree
Definition:
class.ilECSCmsTree.php:13
ilECSCmsTree\lookupRootId
static lookupRootId($a_tree_id)
lookup root id
Definition:
class.ilECSCmsTree.php:77
ilECSCmsTree\insertRootNode
insertRootNode($tree, $a_child)
Definition:
class.ilECSCmsTree.php:23
ilECSCmsTree\treeExists
treeExists($a_tree_id)
Check if tree exists.
Definition:
class.ilECSCmsTree.php:61
ilECSCmsTree\deleteByTreeId
static deleteByTreeId($a_tree_id)
Delete tree by tree_id.
Definition:
class.ilECSCmsTree.php:46
ilECSCmsTree\__construct
__construct($a_tree_id)
Definition:
class.ilECSCmsTree.php:14
ilTree
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Definition:
class.ilTree.php:25
ilTree\setObjectTablePK
setObjectTablePK($a_column_name)
set column containing primary key in object table @access public
Definition:
class.ilTree.php:403
ilTree\useCache
useCache($a_use=true)
Use Cache (usually activated)
Definition:
class.ilTree.php:243
ilTree\setTableNames
setTableNames($a_table_tree, $a_table_obj_data, $a_table_obj_reference="")
set table names The primary key of the table containing your object_data must be 'obj_id' You may use...
Definition:
class.ilTree.php:359
$GLOBALS
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Definition:
generate-standalone.php:18
$query
$query
Definition:
proxy_ylocal.php:13
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
$ilDB
global $ilDB
Definition:
storeScorm2004.php:19
Services
WebServices
ECS
classes
Tree
class.ilECSCmsTree.php
Generated on Tue Sep 30 2025 19:01:21 for ILIAS by
1.9.4 (using
Doxyfile
)