ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ 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
$DIC
;
26
27
$ilDB
= $DIC[
'ilDB'
];
28
29
$query
=
'INSERT INTO ecs_cms_tree '
.
30
'(tree,child,parent,lft,rgt,depth) '
.
31
'VALUES ( '
.
32
$ilDB
->quote(
$tree
,
'integer'
) .
', '
.
33
$ilDB
->quote($a_child,
'integer'
) .
', '
.
34
$ilDB
->quote(0,
'integer'
) .
', '
.
35
$ilDB
->quote(1,
'integer'
) .
', '
.
36
$ilDB
->quote(100,
'integer'
) .
', '
.
37
$ilDB
->quote(1,
'integer'
) .
' )'
;
38
39
$ilDB
->manipulate(
$query
);
40
41
42
return
true
;
43
}
44
48
public
static
function
deleteByTreeId
($a_tree_id)
49
{
50
global
$DIC
;
51
52
$ilDB
= $DIC[
'ilDB'
];
53
54
$GLOBALS
[
'DIC'
]->logger()->wsrv()->debug(
'Deleting cms tree: '
. $a_tree_id);
55
$query
=
'DELETE FROM ecs_cms_tree '
.
56
'WHERE tree = '
.
$ilDB
->quote($a_tree_id,
'integer'
);
57
$ilDB
->manipulate(
$query
);
58
return
true
;
59
}
60
65
public
function
treeExists
($a_tree_id)
66
{
67
global
$DIC
;
68
69
$ilDB
= $DIC[
'ilDB'
];
70
71
$query
=
'SELECT COUNT(*) num FROM ecs_cms_tree WHERE tree = '
.
$ilDB
->quote($a_tree_id,
'integer'
);
72
$res
=
$ilDB
->query(
$query
);
73
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
74
return
$row
->num > 0 ? true :
false
;
75
}
76
return
false
;
77
}
78
79
83
public
static
function
lookupRootId
($a_tree_id)
84
{
85
global
$DIC
;
86
87
$ilDB
= $DIC[
'ilDB'
];
88
89
$query
=
'SELECT child FROM ecs_cms_tree WHERE tree = '
.
$ilDB
->quote($a_tree_id,
'integer'
);
90
$res
=
$ilDB
->query(
$query
);
91
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
92
return
$row
->child;
93
}
94
return
0;
95
}
96
}
$DIC
global $DIC
Definition:
saml.php:7
ilECSCmsTree\insertRootNode
insertRootNode($tree, $a_child)
Definition:
class.ilECSCmsTree.php:23
ilECSCmsTree\lookupRootId
static lookupRootId($a_tree_id)
lookup root id
Definition:
class.ilECSCmsTree.php:83
ilTree\setObjectTablePK
setObjectTablePK($a_column_name)
set column containing primary key in object table public
Definition:
class.ilTree.php:405
ilECSCmsTree
Definition:
class.ilECSCmsTree.php:12
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
$tree
$tree
Definition:
calendarserver.php:37
$query
$query
Definition:
proxy_ylocal.php:13
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:361
ilTree
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Definition:
class.ilTree.php:24
$row
$row
Definition:
migrateto20.php:360
ilECSCmsTree\__construct
__construct($a_tree_id)
Definition:
class.ilECSCmsTree.php:14
ilECSCmsTree\treeExists
treeExists($a_tree_id)
Check if tree exists.
Definition:
class.ilECSCmsTree.php:65
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
php
ilECSCmsTree\deleteByTreeId
static deleteByTreeId($a_tree_id)
Delete tree by tree_id.
Definition:
class.ilECSCmsTree.php:48
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilTree\useCache
useCache($a_use=true)
Use Cache (usually activated)
Definition:
class.ilTree.php:244
$GLOBALS
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
Definition:
module.tag.xmp.php:702
Services
WebServices
ECS
classes
Tree
class.ilECSCmsTree.php
Generated on Thu Feb 27 2025 19:02:08 for ILIAS by
1.8.13 (using
Doxyfile
)