33 $this->
setTableNames(
'tree_workspace',
'object_data',
'object_reference_ws');
52 "SELECT * FROM tree_workspace " .
72 $next_id =
$ilDB->nextId($this->table_obj_reference);
74 $fields = array($this->ref_pk => array(
"integer", $next_id),
75 $this->obj_pk => array(
"integer", $a_object_id));
77 $ilDB->insert($this->table_obj_reference, $fields);
91 $set =
$ilDB->query(
"SELECT " . $this->obj_pk .
92 " FROM " . $this->table_obj_reference .
93 " WHERE " . $this->ref_pk .
" = " .
$ilDB->quote($a_node_id,
"integer"));
110 $set =
$ilDB->query(
"SELECT " . $this->ref_pk .
111 " FROM " . $this->table_obj_reference .
112 " WHERE " . $this->obj_pk .
" = " .
$ilDB->quote($a_obj_id,
"integer"));
127 $set =
$ilDB->query(
"SELECT tree" .
128 " FROM " . $this->table_obj_reference .
129 " JOIN " . $this->table_tree .
" ON (" . $this->table_obj_reference .
"." . $this->ref_pk .
" = " . $this->table_tree .
".child)" .
130 " WHERE " . $this->ref_pk .
" = " .
$ilDB->quote($a_node_id,
"integer"));
133 return (
int) (
$res[
"tree"] ?? 0);
144 int $a_parent_node_id,
148 $this->
insertNode($node_id, $a_parent_node_id);
159 $query =
"DELETE FROM " . $this->table_obj_reference .
160 " WHERE " . $this->ref_pk .
" = " .
$ilDB->quote($a_node_id,
"integer");
161 return $ilDB->manipulate($query);
169 $root_id = $this->readRootId();
174 $root = $this->getNodeData($root_id);
179 $nodes = $this->getSubTree($root);
180 foreach ($nodes as $node) {
181 $access_handler->removePermission($node[
"wsp_id"]);
188 $this->deleteReference($node[
"wsp_id"]);
191 $this->deleteTree($root);
200 bool $a_with_data =
false
203 $this->getNodeData($this->getRootId()),
216 $root =
new $root(0);
219 $root_id = $this->createReference($root->getId());
220 $this->addTree($a_user_id, $root_id);
221 $this->setRootId($root_id);
static getClassByType(string $obj_type)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
setReferenceTablePK(string $a_column_name)
set column containing primary key in reference table
insertNode(int $a_node_id, int $a_parent_id, int $a_pos=self::POS_LAST_NODE, bool $a_reset_deletion_date=false)
insert new node with node_id under parent node with parent_id
string $ref_pk
column name containing primary key in reference table
string $obj_pk
column name containing primary key in object table
setTreeTablePK(string $a_column_name)
set column containing primary key in tree table
setObjectTablePK(string $a_column_name)
set column containing primary key in object table
setTableNames(string $a_table_tree, string $a_table_obj_data, string $a_table_obj_reference="")
set table names The primary key of the table containing your object_data must be 'obj_id' You may use...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(int $a_tree_id, int $a_root_id=0)
createReference(int $a_object_id)
Create workspace reference for object.
deleteReference(int $a_node_id)
Delete object from reference table.
cascadingDelete()
Remove all tree and node data.
lookupObjectId(int $a_node_id)
Get object id for node id.
lookupNodeId(int $a_obj_id)
Get node id for object id As we do not allow references in workspace this should not be ambigious.
getObjectsFromType(string $a_type, bool $a_with_data=false)
Get all workspace objects of specific type.
insertObject(int $a_parent_node_id, int $a_object_id)
Add object to tree.
lookupOwner(int $a_node_id)
Get owner for node id.
createTreeForUser(int $a_user_id)
Create personal workspace tree for user.
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
fetchAssoc(ilDBStatement $statement)
queryF(string $query, array $types, array $values)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc