ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
|
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco. More...
Public Member Functions | |
__construct (int $a_tree_id, int $a_root_id=0, ?ilDBInterface $db=null) | |
initTreeImplementation () | |
Init tree implementation. More... | |
getTreeImplementation () | |
Get tree implementation. More... | |
useCache (bool $a_use=true) | |
Use Cache (usually activated) More... | |
getDepthCache () | |
Get depth cache. More... | |
getParentCache () | |
Get parent cache. More... | |
initLangCode () | |
Do not use it Store user language. More... | |
getTreeTable () | |
Get tree table name. More... | |
getObjectDataTable () | |
Get object data table. More... | |
getTreePk () | |
Get tree primary key. More... | |
getTableReference () | |
Get reference table if available. More... | |
getGap () | |
Get default gap. More... | |
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 a reference table. More... | |
setReferenceTablePK (string $a_column_name) | |
set column containing primary key in reference table More... | |
setObjectTablePK (string $a_column_name) | |
set column containing primary key in object table More... | |
setTreeTablePK (string $a_column_name) | |
set column containing primary key in tree table More... | |
buildJoin () | |
build join depending on table settings @access private More... | |
getRelation (int $a_node_a, int $a_node_b) | |
Get relation of two nodes. More... | |
getRelationOfNodes (array $a_node_a_arr, array $a_node_b_arr) | |
get relation of two nodes by node data More... | |
getChildIds (int $a_node) | |
getChilds (int $a_node_id, string $a_order="", string $a_direction="ASC") | |
get child nodes of given node More... | |
getFilteredChilds (array $a_filter, int $a_node, string $a_order="", string $a_direction="ASC") | |
get child nodes of given node (exclude filtered obj_types) More... | |
getChildsByType (int $a_node_id, string $a_type) | |
get child nodes of given node by object type More... | |
getChildsByTypeFilter (int $a_node_id, array $a_types, string $a_order="", string $a_direction="ASC") | |
get child nodes of given node by object type More... | |
insertNodeFromTrash (int $a_source_id, int $a_target_id, int $a_tree_id, int $a_pos=self::POS_LAST_NODE, bool $a_reset_deleted_date=false) | |
Insert node from trash deletes trash entry. More... | |
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 More... | |
getFilteredSubTree (int $a_node_id, array $a_filter=[]) | |
get filtered subtree get all subtree nodes beginning at a specific node excluding specific object types and their child nodes. More... | |
getSubTreeIds (int $a_ref_id) | |
Get all ids of subnodes. More... | |
getSubTree (array $a_node, bool $a_with_data=true, array $a_type=[]) | |
get all nodes in the subtree under specified node More... | |
deleteTree (array $a_node) | |
delete node and the whole subtree under this node More... | |
validateParentRelations () | |
Validate parent relations of tree. More... | |
getPathFull (int $a_endnode_id, int $a_startnode_id=0) | |
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnode. More... | |
preloadDepthParent (array $a_node_ids) | |
Preload depth/parent. More... | |
getPathId (int $a_endnode_id, int $a_startnode_id=0) | |
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnode More... | |
getNodePath (int $a_endnode_id, int $a_startnode_id=0) | |
Returns the node path for the specified object reference. More... | |
checkTree () | |
check consistence of tree all left & right values are checked if they are exists only once More... | |
checkTreeChilds (bool $a_no_zero_child=true) | |
check, if all childs of tree nodes exist in object table More... | |
getMaximumDepth () | |
Return the current maximum depth in the tree. More... | |
getDepth (int $a_node_id) | |
return depth of a node in tree More... | |
getNodeTreeData (int $a_node_id) | |
return all columns of tabel tree More... | |
getNodeData (int $a_node_id, ?int $a_tree_pk=null) | |
get all information of a node. More... | |
fetchNodeData (array $a_row) | |
get data of parent node from tree and object_data More... | |
isInTree (?int $a_node_id) | |
get all information of a node. More... | |
getParentNodeData (int $a_node_id) | |
get data of parent node from tree and object_data More... | |
isGrandChild (int $a_startnode_id, int $a_querynode_id) | |
checks if a node is in the path of an other node More... | |
addTree (int $a_tree_id, int $a_node_id=-1) | |
create a new tree to do: ??? More... | |
removeTree (int $a_tree_id) | |
remove an existing tree More... | |
moveToTrash (int $a_node_id, bool $a_set_deleted=false, int $a_deleted_by=0) | |
Move node to trash bin. More... | |
isDeleted (int $a_node_id) | |
This is a wrapper for isSaved() with a more useful name. More... | |
preloadDeleted (array $a_node_ids) | |
Preload deleted information. More... | |
getSavedNodeData (int $a_parent_id) | |
get data saved/deleted nodes More... | |
getSavedNodeObjIds (array $a_obj_ids) | |
get object id of saved/deleted nodes More... | |
getParentId (int $a_node_id) | |
get parent id of given node More... | |
getChildSequenceNumber (array $a_node, string $type="") | |
get sequence number of node in sibling sequence More... | |
readRootId () | |
getRootId () | |
setRootId (int $a_root_id) | |
getTreeId () | |
fetchSuccessorNode (int $a_node_id, string $a_type="") | |
get node data of successor node More... | |
fetchPredecessorNode (int $a_node_id, string $a_type="") | |
get node data of predecessor node More... | |
renumber (int $node_id=1, int $i=1) | |
Wrapper for renumber. More... | |
checkForParentType (int $a_ref_id, string $a_type, bool $a_exclude_source_check=false) | |
Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentType(3,'crs');. More... | |
__isMainTree () | |
Check if operations are done on main tree. More... | |
moveTree (int $a_source_id, int $a_target_id, int $a_location=self::POS_LAST_NODE) | |
Move Tree Implementation @access public. More... | |
getRbacSubtreeInfo (int $a_endnode_id) | |
This method is used for change existing objects and returns all necessary information for this action. More... | |
getSubTreeQuery (int $a_node_id, array $a_fields=[], array $a_types=[], bool $a_force_join_reference=false) | |
Get tree subtree query. More... | |
getTrashSubTreeQuery (int $a_node_id, array $a_fields=[], array $a_types=[], bool $a_force_join_reference=false) | |
getSubTreeFilteredByObjIds (int $a_node_id, array $a_obj_ids, array $a_fields=[]) | |
get all node ids in the subtree under specified node id, filter by object ids More... | |
deleteNode (int $a_tree_id, int $a_node_id) | |
lookupTrashedObjectTypes () | |
Lookup object types in trash. More... | |
Static Public Member Functions | |
static | lookupTreesForNode (int $node_id) |
static | _removeEntry (int $a_tree, int $a_child, string $a_db_table="tree") |
STATIC METHOD Removes a single entry from a tree. More... | |
Data Fields | |
const | TREE_TYPE_MATERIALIZED_PATH = 'mp' |
const | TREE_TYPE_NESTED_SET = 'ns' |
const | POS_LAST_NODE = -2 |
const | POS_FIRST_NODE = -1 |
const | RELATION_CHILD = 1 |
const | RELATION_PARENT = 2 |
const | RELATION_SIBLING = 3 |
const | RELATION_EQUALS = 4 |
const | RELATION_NONE = 5 |
Protected Member Functions | |
isCacheUsed () | |
Check if cache is active. More... | |
resetInTreeCache () | |
reset in tree cache More... | |
fetchTranslationFromObjectDataCache (array $a_obj_ids) | |
Get translation data from object cache (trigger in object cache on preload) More... | |
__renumber (int $node_id=1, int $i=1) | |
This method is private. More... | |
__checkDelete (array $a_node) | |
Check for deleteTree() compares a subtree of a given node by checking lft, rgt against parent relation. More... | |
__getSubTreeByParentRelation (int $a_node_id, array &$parent_childs) | |
__validateSubtrees (array &$lft_childs, array $parent_childs) | |
isRepositoryTree () | |
check if current tree instance operates on repository tree table More... | |
Protected Attributes | |
const | DEFAULT_LANGUAGE = 'en' |
const | DEFAULT_GAP = 50 |
ilLogger | $logger |
ilDBInterface | $db |
ilAppEventHandler | $eventHandler |
int | $root_id |
points to root node (may be a subtree) More... | |
int | $tree_id |
to use different trees in one db-table More... | |
string | $table_tree |
table name of tree table More... | |
string | $table_obj_data |
table name of object_data table More... | |
string | $table_obj_reference |
table name of object_reference table More... | |
string | $ref_pk |
column name containing primary key in reference table More... | |
string | $obj_pk |
column name containing primary key in object table More... | |
string | $tree_pk |
column name containing tree id in tree table More... | |
bool | $use_cache |
array | $oc_preloaded = [] |
array | $depth_cache = [] |
array | $parent_cache = [] |
array | $in_tree_cache = [] |
array | $translation_cache = [] |
array | $parent_type_cache = [] |
array | $is_saved_cache = [] |
Private Attributes | |
string | $lang_code |
int | $gap |
Size of the gaps to be created in the nested sets sequence numbering of the tree nodes. More... | |
ilTreeImplementation | $tree_impl = null |
array | $path_id_cache = [] |
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco.
Definition at line 29 of file class.ilTree.php.
ilTree::__construct | ( | int | $a_tree_id, |
int | $a_root_id = 0 , |
||
?ilDBInterface | $db = null |
||
) |
InvalidArgumentException |
Definition at line 133 of file class.ilTree.php.
References $db, $DIC, DEFAULT_GAP, DEFAULT_LANGUAGE, ilLogLevel\ERROR, ilLoggerFactory\getLogger(), initTreeImplementation(), ILIAS\Repository\logger(), and ROOT_FOLDER_ID.
|
protected |
Check for deleteTree() compares a subtree of a given node by checking lft, rgt against parent relation.
ilInvalidTreeStructureException |
Definition at line 1791 of file class.ilTree.php.
References $counter, $message, $res, ILIAS\Repository\int(), and ILIAS\Repository\logger().
|
protected |
ilInvalidTreeStructureException |
Definition at line 1823 of file class.ilTree.php.
References $counter, $message, $res, ILIAS\Repository\int(), and ILIAS\Repository\logger().
ilTree::__isMainTree | ( | ) |
Check if operations are done on main tree.
Definition at line 1780 of file class.ilTree.php.
Referenced by initTreeImplementation(), and isCacheUsed().
|
protected |
This method is private.
Always call ilTree->renumber() since it locks the tree table renumber left/right values and close the gaps in numbers (recursive)
Definition at line 1630 of file class.ilTree.php.
References $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().
|
protected |
array | $lft_childs | |
array | $parent_childs |
ilInvalidTreeStructureException |
Definition at line 1866 of file class.ilTree.php.
References $message, ILIAS\Repository\logger(), and ROOT_FOLDER_ID.
|
static |
STATIC METHOD Removes a single entry from a tree.
The tree structure is NOT updated!
InvalidArgumentException |
Definition at line 1750 of file class.ilTree.php.
References $DIC, $message, $res, ilLoggerFactory\getLogger(), ilDBInterface\manipulateF(), and ROOT_FOLDER_ID.
Referenced by ilSystemCheckTrash\removeSelectedFromSystem().
ilTree::addTree | ( | int | $a_tree_id, |
int | $a_node_id = -1 |
||
) |
create a new tree to do: ???
Definition at line 1287 of file class.ilTree.php.
References $DIC, $message, $res, and ILIAS\Repository\logger().
ilTree::buildJoin | ( | ) |
build join depending on table settings @access private
Definition at line 380 of file class.ilTree.php.
Referenced by ilSCORMTree\getChilds().
ilTree::checkForParentType | ( | int | $a_ref_id, |
string | $a_type, | ||
bool | $a_exclude_source_check = false |
||
) |
Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentType(3,'crs');.
Definition at line 1700 of file class.ilTree.php.
References $path, and ILIAS\Repository\int().
Referenced by ilEventParticipants\__read(), ilAppointmentPresentationGUI\addContainerInfo(), ilObjSessionGUI\eventsListObject(), ilObjFolderGUI\forwardToTimingsView(), ilContainerSortingSettings\getInheritedSettings(), ilLPStatusCollection\getMembers(), ilObjFolder\getViewMode(), ilObjSessionGUI\initContainer(), ilObjectRolePermissionTableGUI\initFilter(), ilRepositoryExplorer\isVisible(), ilObjectGUI\isVisible(), ilObjFolderGUI\modifyItemGUI(), ilObjSessionGUI\modifyItemGUI(), ilObject\selfOrParentWithRatingEnabled(), and ilObjBlogGUI\setSettingsSubTabs().
ilTree::checkTree | ( | ) |
check consistence of tree all left & right values are checked if they are exists only once
Definition at line 924 of file class.ilTree.php.
References $message, $res, and ILIAS\Repository\logger().
ilTree::checkTreeChilds | ( | bool | $a_no_zero_child = true | ) |
check, if all childs of tree nodes exist in object table
ilInvalidTreeStructureException |
Definition at line 952 of file class.ilTree.php.
References $message, and ILIAS\Repository\logger().
ilTree::deleteNode | ( | int | $a_tree_id, |
int | $a_node_id | ||
) |
Definition at line 1998 of file class.ilTree.php.
ilTree::deleteTree | ( | array | $a_node | ) |
delete node and the whole subtree under this node
Definition at line 758 of file class.ilTree.php.
References ilLogLevel\ERROR, and ILIAS\Repository\logger().
Referenced by ILIAS\Skill\Node\SkillTreeNodeManager\clipboardCut(), and ilObjContentObjectGUI\confirmedDelete().
ilTree::fetchNodeData | ( | array | $a_row | ) |
get data of parent node from tree and object_data
Definition at line 1112 of file class.ilTree.php.
References $data, $DIC, $lng, $res, ilContainerReference\_lookupTitle(), ilObject\DESC_LENGTH, ROLE_FOLDER_ID, and ilStr\shortenTextExtended().
Referenced by ilSCORMTree\getChilds().
ilTree::fetchPredecessorNode | ( | int | $a_node_id, |
string | $a_type = "" |
||
) |
get node data of predecessor node
LogicException |
Definition at line 1590 of file class.ilTree.php.
References $message, and ILIAS\Repository\logger().
ilTree::fetchSuccessorNode | ( | int | $a_node_id, |
string | $a_type = "" |
||
) |
get node data of successor node
LogicException |
Definition at line 1574 of file class.ilTree.php.
References $message, and ILIAS\Repository\logger().
|
protected |
Get translation data from object cache (trigger in object cache on preload)
array | $a_obj_ids | object ids |
Definition at line 1188 of file class.ilTree.php.
ilTree::getChildIds | ( | int | $a_node | ) |
int | $a_node |
Definition at line 416 of file class.ilTree.php.
References $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().
ilTree::getChilds | ( | int | $a_node_id, |
string | $a_order = "" , |
||
string | $a_direction = "ASC" |
||
) |
get child nodes of given node
Reimplemented in ilSCORMTree, and ilGlobalSkillTree.
Definition at line 435 of file class.ilTree.php.
References $DIC, $res, and ILIAS\Repository\int().
Referenced by ilAdminSubItemsTableGUI\getItems(), ilSkillTree\getMaxOrderNr(), ilClassificationBlockGUI\getSubItemIds(), ilTaggingClassificationProvider\getSubTreeTags(), ilTreeExplorerGUI\getTreeComponent(), ilObjWorkspaceFolder\gotItems(), ILIAS\Skill\Node\SkillTreeNodeManager\putIntoTree(), ilObjContentObjectGUI\showExportIDsOverview(), and ilContainerXmlWriter\writeSubitems().
ilTree::getChildsByType | ( | int | $a_node_id, |
string | $a_type | ||
) |
get child nodes of given node by object type
Definition at line 533 of file class.ilTree.php.
References $res.
Referenced by ilItemGroupItems\_getItemsOfContainer(), ilEventItems\_getItemsOfContainer(), ilSessionAppointment\lookupLastSessionByCourse(), ilSessionAppointment\lookupNextSessionByCourse(), and assQuestionGUI\outPageSelector().
ilTree::getChildsByTypeFilter | ( | int | $a_node_id, |
array | $a_types, | ||
string | $a_order = "" , |
||
string | $a_direction = "ASC" |
||
) |
get child nodes of given node by object type
Definition at line 576 of file class.ilTree.php.
References ilArrayUtil\quoteArray().
Referenced by ilCheckSumOfWorkspaceFileSizesJob\calculateRecursive().
ilTree::getChildSequenceNumber | ( | array | $a_node, |
string | $type = "" |
||
) |
get sequence number of node in sibling sequence
LogicException |
Definition at line 1527 of file class.ilTree.php.
References $message, and ILIAS\Repository\logger().
ilTree::getDepth | ( | int | $a_node_id | ) |
return depth of a node in tree
Definition at line 1036 of file class.ilTree.php.
ilTree::getDepthCache | ( | ) |
Get depth cache.
Definition at line 251 of file class.ilTree.php.
References $depth_cache.
ilTree::getFilteredChilds | ( | array | $a_filter, |
int | $a_node, | ||
string | $a_order = "" , |
||
string | $a_direction = "ASC" |
||
) |
get child nodes of given node (exclude filtered obj_types)
string[] | objects to filter (e.g array('rolf')) |
int | node_id |
string | sort order of returned childs, optional (possible values: 'title','desc','last_update' or 'type') |
string | sort direction, optional (possible values: 'DESC' or 'ASC'; defalut is 'ASC') |
Definition at line 512 of file class.ilTree.php.
ilTree::getFilteredSubTree | ( | int | $a_node_id, |
array | $a_filter = [] |
||
) |
get filtered subtree get all subtree nodes beginning at a specific node excluding specific object types and their child nodes.
E.g getFilteredSubTreeNodes()
Definition at line 697 of file class.ilTree.php.
ilTree::getGap | ( | ) |
Get default gap.
Definition at line 317 of file class.ilTree.php.
References $gap.
ilTree::getMaximumDepth | ( | ) |
Return the current maximum depth in the tree.
Definition at line 1022 of file class.ilTree.php.
ilTree::getNodeData | ( | int | $a_node_id, |
?int | $a_tree_pk = null |
||
) |
get all information of a node.
get data of a specific node from tree and object_data
InvalidArgumentException |
Reimplemented in ilGlobalSkillTree.
Definition at line 1085 of file class.ilTree.php.
References $message, $res, and ILIAS\Repository\logger().
Referenced by ilPersonalSkillExplorerGUI\__construct(), ilCourseObjectiveMaterials\_getAssignableMaterials(), ilCourseObjectiveQuestion\_getAssignableTests(), ilObjSCORMLearningModule\_getTrackingItems(), ILIAS\Skill\Node\SkillTreeNodeManager\clipboardCopy(), ILIAS\Skill\Node\SkillTreeNodeManager\clipboardCut(), ilObjContentObjectGUI\confirmedDelete(), ilObjSessionGUI\eventsListObject(), ilSessionOverviewGUI\exportCSV(), ilRepositoryExplorer\formatHeader(), ilSessionOverviewTableGUI\gatherEvents(), ilGlobalVirtualSkillTree\getChildsOfNode(), ilSessionMaterialsTableGUI\getDataFromDb(), ilFavouritesDBRepository\getFavouritesOfUser(), ilTaggingClassificationProvider\getSubTreeTags(), ilTreeExplorerGUI\getTreeComponent(), ilPCFileListGUI\initEditForm(), ilTestTaxonomyTree\initOrderedTreeIndex(), ilPCFileListGUI\insertNewFileItem(), ilPCFileItemGUI\insertNewItemAfter(), ilPCFileItemGUI\insertNewItemBefore(), assQuestionGUI\outPageSelector(), ilRepositorySelectorInputGUI\render(), and ilSurveyCronNotification\run().
ilTree::getNodePath | ( | int | $a_endnode_id, |
int | $a_startnode_id = 0 |
||
) |
Returns the node path for the specified object reference.
Note: this function returns the same result as getNodePathForTitlePath, but takes ref-id's as parameters. This function differs from getPathFull, in the following aspects:
Definition at line 887 of file class.ilTree.php.
ilTree::getNodeTreeData | ( | int | $a_node_id | ) |
return all columns of tabel tree
InvalidArgumentException |
Definition at line 1062 of file class.ilTree.php.
References $DIC, $res, ilLogLevel\ERROR, ilDBConstants\FETCHMODE_ASSOC, and ILIAS\Repository\logger().
ilTree::getObjectDataTable | ( | ) |
Get object data table.
Definition at line 293 of file class.ilTree.php.
References $table_obj_data.
ilTree::getParentCache | ( | ) |
Get parent cache.
Definition at line 259 of file class.ilTree.php.
References $parent_cache.
ilTree::getParentId | ( | int | $a_node_id | ) |
get parent id of given node
InvalidArgumentException |
Definition at line 1496 of file class.ilTree.php.
Referenced by ilOrgUnitExtension\__construct(), ilObjItemGroupGUI\_goto(), ilObjPollGUI\_goto(), ilSurveyExecutionGUI\backToRepository(), ilObjSessionGUI\cancelEditObject(), ilSurveyEditorGUI\createQuestionPool(), ilPCQuestionGUI\createQuestionPool(), ilObjSessionGUI\createRecurringSessions(), ilAdministrationCommandGUI\cut(), ilObjMediaPoolGUI\executeCommand(), ilObjSessionGUI\executeCommand(), ilFavouritesDBRepository\getFavouritesOfUser(), ilRepositorySelectorInputGUI\getHighlightedNode(), ilObjSessionGUI\getTabs(), ilObjItemGroupGUI\gotoParent(), ilObjSessionGUI\handleFileUpload(), ilConditionSelector\isNodeVisible(), ilAdministrationCommandGUI\link(), ilObjItemGroupGUI\listMaterials(), ilObjSessionGUI\redirectToParentContentPageObject(), ilObjMediaPoolGUI\returnFromItem(), ilObjItemGroupGUI\setTabs(), ilAdministrationCommandGUI\showPasteTree(), ilECSCourseCreationHandler\syncNodeToTop(), and ilObjSessionGUI\unregisterObject().
ilTree::getParentNodeData | ( | int | $a_node_id | ) |
get data of parent node from tree and object_data
Definition at line 1243 of file class.ilTree.php.
Referenced by ilObjIndividualAssessment\getParentContainerIdByType().
ilTree::getPathFull | ( | int | $a_endnode_id, |
int | $a_startnode_id = 0 |
||
) |
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnode.
This function chooses the algorithm to be used.
Definition at line 788 of file class.ilTree.php.
References $q, and ilDBConstants\FETCHMODE_ASSOC.
Referenced by ilObjContentObject\_checkPreconditionsOfPage(), ilNewsItem\_getDefaultVisibilityForRefId(), ilObjContentObject\_getMissingPreconditionsTopChapter(), ilLocatorGUI\addAdministrationItems(), ilLocatorGUI\addContextItems(), ilObjMediaPoolGUI\addLocatorItems(), ilLocatorGUI\addRepositoryItems(), ilRepositoryTrashGUI\buildPath(), ilSurveySyncTableGUI\buildPath(), ilSurveyEvaluationGUI\cancelEvaluationAccess(), ilClassificationBlockGUI\filterContainer(), ilFeedWriter\getContextPath(), ILIAS\Awareness\User\ProviderCurrentCourse\getInitialUserSet(), ilRecommendedContentRoleTableGUI\getItems(), ilObjTaxonomyAdministration\getPath(), ilTestTaxonomyTree\getPathNodes(), ilTaxMDGUI\getSelectableTaxonomies(), and ilSkillTree\getSkillTreePath().
ilTree::getPathId | ( | int | $a_endnode_id, |
int | $a_startnode_id = 0 |
||
) |
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnode
Definition at line 857 of file class.ilTree.php.
References ilLogLevel\ERROR, and ILIAS\Repository\logger().
Referenced by ILIAS\Skill\Node\SkillTreeNodeManager\clipboardCut(), ilWorkspaceFolderUserSettings\getEffectiveSortation(), ilRepositoryExplorerGUI\getTopNodeForRefId(), ilSkillTree\getTopParentNodeId(), ilObjectLP\handleMove(), and ilSkillNotifications\sendMail().
ilTree::getRbacSubtreeInfo | ( | int | $a_endnode_id | ) |
This method is used for change existing objects and returns all necessary information for this action.
The former use of ilTree::getSubtree needs to much memory.
Definition at line 1927 of file class.ilTree.php.
ilTree::getRelation | ( | int | $a_node_a, |
int | $a_node_b | ||
) |
Get relation of two nodes.
Definition at line 396 of file class.ilTree.php.
ilTree::getRelationOfNodes | ( | array | $a_node_a_arr, |
array | $a_node_b_arr | ||
) |
get relation of two nodes by node data
Definition at line 407 of file class.ilTree.php.
ilTree::getRootId | ( | ) |
Definition at line 1555 of file class.ilTree.php.
Referenced by ilObjMediaPoolGUI\addLocatorItems(), ilTestTaxonomyTree\initOrderedTreeIndex(), ILIAS\MediaPool\Tree\MediaPoolTree\insertInMepTree(), and assQuestionGUI\outPageSelector().
ilTree::getSavedNodeData | ( | int | $a_parent_id | ) |
get data saved/deleted nodes
InvalidArgumentException |
Definition at line 1445 of file class.ilTree.php.
References $DIC, $message, $res, and ILIAS\Repository\logger().
ilTree::getSavedNodeObjIds | ( | array | $a_obj_ids | ) |
get object id of saved/deleted nodes
Definition at line 1475 of file class.ilTree.php.
References $DIC, $res, and ILIAS\Repository\int().
ilTree::getSubTree | ( | array | $a_node, |
bool | $a_with_data = true , |
||
array | $a_type = [] |
||
) |
get all nodes in the subtree under specified node
remove the in cache exception for lm tree
refactor $a_type to string[]
Definition at line 735 of file class.ilTree.php.
References $res, and ILIAS\Repository\int().
Referenced by ilPersonalSkillExplorerGUI\__construct(), ilCourseObjectiveMaterials\_getAssignableMaterials(), ilCourseObjectiveQuestion\_getAssignableTests(), ilObjSCORMLearningModule\_getTrackingItems(), ILIAS\Skill\Node\SkillTreeNodeManager\clipboardCopy(), ilObjSessionGUI\eventsListObject(), ilNewsItem\getAggregatedNewsData(), ilSessionMaterialsTableGUI\getDataFromDb(), ilTaggingClassificationProvider\getSubTreeTags(), ilTestTaxonomyTree\initOrderedTreeIndex(), and ilSurveyCronNotification\run().
ilTree::getSubTreeFilteredByObjIds | ( | int | $a_node_id, |
array | $a_obj_ids, | ||
array | $a_fields = [] |
||
) |
get all node ids in the subtree under specified node id, filter by object ids
int[] | $a_obj_ids | |
string[] | $a_fields |
Definition at line 1969 of file class.ilTree.php.
References $res.
Referenced by ilClassificationBlockGUI\filterContainer(), and ilClassificationBlockGUI\getSubItemIds().
ilTree::getSubTreeIds | ( | int | $a_ref_id | ) |
Get all ids of subnodes.
int | $a_ref_id |
Definition at line 725 of file class.ilTree.php.
Referenced by ilObjectLP\handleMove().
ilTree::getSubTreeQuery | ( | int | $a_node_id, |
array | $a_fields = [] , |
||
array | $a_types = [] , |
||
bool | $a_force_join_reference = false |
||
) |
Get tree subtree query.
Definition at line 1935 of file class.ilTree.php.
ilTree::getTableReference | ( | ) |
Get reference table if available.
Definition at line 309 of file class.ilTree.php.
References $table_obj_reference.
ilTree::getTrashSubTreeQuery | ( | int | $a_node_id, |
array | $a_fields = [] , |
||
array | $a_types = [] , |
||
bool | $a_force_join_reference = false |
||
) |
Definition at line 1949 of file class.ilTree.php.
ilTree::getTreeId | ( | ) |
Definition at line 1565 of file class.ilTree.php.
Referenced by ilWorkspaceTree\exists(), ilSkillTree\getChildsByTypeFilter(), ilSkillTree\initChildsData(), and ILIAS\Skill\Node\SkillDeletionManager\updateProfileCompletions().
ilTree::getTreeImplementation | ( | ) |
Get tree implementation.
Definition at line 227 of file class.ilTree.php.
References $tree_impl.
ilTree::getTreePk | ( | ) |
ilTree::getTreeTable | ( | ) |
ilTree::initLangCode | ( | ) |
Do not use it Store user language.
This function is used by the "main" tree only (during initialisation).
Definition at line 270 of file class.ilTree.php.
References $DIC, and DEFAULT_LANGUAGE.
ilTree::initTreeImplementation | ( | ) |
Init tree implementation.
Definition at line 202 of file class.ilTree.php.
References $DIC, and __isMainTree().
Referenced by __construct().
ilTree::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
InvalidArgumentException |
Definition at line 647 of file class.ilTree.php.
References $message, ilLogLevel\ERROR, and ILIAS\Repository\logger().
Referenced by ilObjMediaPoolGUI\executeCommand(), ILIAS\MediaPool\Tree\MediaPoolTree\insertInMepTree(), ILIAS\Skill\Node\SkillTreeNodeManager\putIntoTree(), and ilObjFolder\putInTree().
ilTree::insertNodeFromTrash | ( | int | $a_source_id, |
int | $a_target_id, | ||
int | $a_tree_id, | ||
int | $a_pos = self::POS_LAST_NODE , |
||
bool | $a_reset_deleted_date = false |
||
) |
Insert node from trash deletes trash entry.
If we have database query exceptions we could wrap insertNode in try/catch and rollback if the insert failed.
Definition at line 620 of file class.ilTree.php.
References ILIAS\Repository\logger(), and ilLogLevel\WARNING.
|
protected |
Check if cache is active.
Reimplemented in ilLMTree.
Definition at line 243 of file class.ilTree.php.
References $use_cache, and __isMainTree().
ilTree::isDeleted | ( | int | $a_node_id | ) |
This is a wrapper for isSaved() with a more useful name.
Definition at line 1390 of file class.ilTree.php.
References $res.
Referenced by ilEventItems\__read(), ilObjCourseGrouping\_checkGroupingDependencies(), ilObjCourseGrouping\_getGroupingCourseIds(), ilObjCourseGrouping\_getGroupingItems(), ilClassificationBlockGUI\filterContainer(), ilObjCourse\findCoursesWithNotEnoughMembers(), ilMembershipNotifications\getActiveUsersforAllObjects(), ILIAS\Blog\Exercise\BlogExercise\getAssignmentsOfBlog(), ilPortfolioExercise\getAssignmentsOfPortfolio(), ilObjStudyProgramme\getReferencesTo(), ilObjTaxonomyAdministration\getRepositoryTaxonomies(), and ilTaggingClassificationProvider\getSubTreeTags().
ilTree::isGrandChild | ( | int | $a_startnode_id, |
int | $a_querynode_id | ||
) |
checks if a node is in the path of an other node
Definition at line 1278 of file class.ilTree.php.
Referenced by ilObjectLP\findMembershipsByPath(), and ilObjectLP\handleMove().
ilTree::isInTree | ( | ?int | $a_node_id | ) |
get all information of a node.
get data of a specific node from tree and object_data
Definition at line 1208 of file class.ilTree.php.
References $res.
Referenced by ilEventItems\__read(), ilNewsItem\_getDefaultVisibilityForRefId(), ILIAS\Skill\Node\SkillTreeNodeManager\clipboardCopy(), ILIAS\Skill\Node\SkillTreeNodeManager\clipboardCut(), ilObjContentObjectGUI\confirmedDelete(), ILIAS\Skill\Resource\SkillResourceDBRepository\getAll(), ilFavouritesDBRepository\getFavouritesOfUser(), ilMediaObjectUsagesTableGUI\getItems(), ilMediaPoolPageUsagesTableGUI\getItems(), ilNavigationHistory\getItems(), ilInternalLinkGUI\init(), assQuestionGUI\outPageSelector(), ILIAS\Skill\Node\SkillTreeNodeManager\putIntoTree(), ilContainerStartObjects\read(), and ilSkillNotifications\sendMail().
|
protected |
check if current tree instance operates on repository tree table
Definition at line 2040 of file class.ilTree.php.
ilTree::lookupTrashedObjectTypes | ( | ) |
Lookup object types in trash.
Definition at line 2020 of file class.ilTree.php.
References $res, and ilDBConstants\FETCHMODE_OBJECT.
|
static |
int | $node_id |
Definition at line 182 of file class.ilTree.php.
References $db, $DIC, $res, ilDBConstants\FETCHMODE_OBJECT, ILIAS\Repository\int(), ilDBInterface\query(), ilDBInterface\quote(), and ilDBConstants\T_INTEGER.
Referenced by ILIAS\Repository\Deletion\TreeStandardAdapter\getTrashTree().
ilTree::moveToTrash | ( | int | $a_node_id, |
bool | $a_set_deleted = false , |
||
int | $a_deleted_by = 0 |
||
) |
Move node to trash bin.
InvalidArgumentException |
Definition at line 1351 of file class.ilTree.php.
References $DIC, $res, ilLogLevel\ERROR, ilDBConstants\FETCHMODE_ASSOC, ILIAS\Repository\int(), ILIAS\Repository\logger(), and ilObject\setDeletedDates().
ilTree::moveTree | ( | int | $a_source_id, |
int | $a_target_id, | ||
int | $a_location = self::POS_LAST_NODE |
||
) |
Move Tree Implementation @access public.
int | source ref_id |
int | target ref_id |
int | location ilTree::POS_LAST_NODE or ilTree::POS_FIRST_NODE |
Definition at line 1904 of file class.ilTree.php.
References $GLOBALS.
ilTree::preloadDeleted | ( | array | $a_node_ids | ) |
Preload deleted information.
Definition at line 1418 of file class.ilTree.php.
References $res.
ilTree::preloadDepthParent | ( | array | $a_node_ids | ) |
Preload depth/parent.
int[] |
Definition at line 834 of file class.ilTree.php.
References $DIC, $res, and ILIAS\Repository\int().
ilTree::readRootId | ( | ) |
Reimplemented in ilGlobalSkillTree.
Definition at line 1539 of file class.ilTree.php.
References $res, and ILIAS\Repository\int().
Referenced by ilLMExplorerGUI\__construct(), ilSolutionExplorer\__construct(), ilTestTaxonomyTree\__construct(), ilLMTree\__construct(), ilWorkspaceTree\__construct(), ilTaxonomyTableGUI\__construct(), ilContainerSelectionExplorer\__construct(), ilObjContentObject\_checkPreconditionsOfPage(), ilObjContentObject\_getMissingPreconditionsTopChapter(), ilObjSCORMLearningModule\_getTrackingItems(), ilObjMediaPoolGUI\afterConstructor(), ilObjSkillTreeGUI\delete(), ilGlobalVirtualSkillTree\getChildsOfNode(), ilSkillTree\getMaxOrderNr(), ilTreeExplorerGUI\getTreeComponent(), ILIAS\Skill\Node\SkillTreeNodeManager\putIntoTree(), ilContentStyleSettingsGUI\saveScope(), ilGroupAddToGroupActionGUI\selectGroup(), ilGroupAddToGroupActionGUI\selectParent(), ilObjContentObjectGUI\showExportIDsOverview(), and ilObjWorkspaceFolderGUI\showMoveIntoObjectTree().
ilTree::removeTree | ( | int | $a_tree_id | ) |
remove an existing tree
Definition at line 1329 of file class.ilTree.php.
References ilLogLevel\ERROR, and ILIAS\Repository\logger().
ilTree::renumber | ( | int | $node_id = 1 , |
int | $i = 1 |
||
) |
Wrapper for renumber.
This method locks the table tree (recursive)
Definition at line 1606 of file class.ilTree.php.
|
protected |
reset in tree cache
Definition at line 325 of file class.ilTree.php.
ilTree::setObjectTablePK | ( | string | $a_column_name | ) |
set column containing primary key in object table
Definition at line 362 of file class.ilTree.php.
Referenced by ilECSCmsTree\__construct(), and ilWorkspaceTree\__construct().
ilTree::setReferenceTablePK | ( | string | $a_column_name | ) |
set column containing primary key in reference table
Definition at line 354 of file class.ilTree.php.
Referenced by ilWorkspaceTree\__construct().
ilTree::setRootId | ( | int | $a_root_id | ) |
Definition at line 1560 of file class.ilTree.php.
ilTree::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 a reference table.
If no reference table is specified the given tree table is directly joined with the given object_data table. The primary key in object_data table and its foreign key in reference table must have the same name!
Definition at line 338 of file class.ilTree.php.
Referenced by ilSCORM2004Tree\__construct(), ilTaxonomyTree\__construct(), ilSCORMTree\__construct(), ilECSCmsTree\__construct(), ilLMTree\__construct(), ilWorkspaceTree\__construct(), ilSkillTree\__construct(), ILIAS\MediaPool\Tree\MediaPoolTree\__construct(), and ilObjMediaPool\_getPoolTree().
ilTree::setTreeTablePK | ( | string | $a_column_name | ) |
set column containing primary key in tree table
Definition at line 370 of file class.ilTree.php.
Referenced by ilSCORM2004Tree\__construct(), ilTaxonomyTree\__construct(), ilSCORMTree\__construct(), ilLMTree\__construct(), ilWorkspaceTree\__construct(), ilSkillTree\__construct(), ILIAS\MediaPool\Tree\MediaPoolTree\__construct(), and ilObjMediaPool\_getPoolTree().
ilTree::useCache | ( | bool | $a_use = true | ) |
Use Cache (usually activated)
Definition at line 235 of file class.ilTree.php.
Referenced by ilECSCmsTree\__construct(), and ilLMTree\__construct().
ilTree::validateParentRelations | ( | ) |
Validate parent relations of tree.
Definition at line 778 of file class.ilTree.php.
|
protected |
Definition at line 47 of file class.ilTree.php.
Referenced by __construct(), ilWorkspaceTree\createReference(), ilWorkspaceTree\exists(), ilSkillTree\initChildsData(), ilWorkspaceTree\lookupNodeId(), ilWorkspaceTree\lookupObjectId(), ilWorkspaceTree\lookupOwner(), and lookupTreesForNode().
|
protected |
Definition at line 119 of file class.ilTree.php.
Referenced by getDepthCache().
|
protected |
Definition at line 48 of file class.ilTree.php.
|
private |
Size of the gaps to be created in the nested sets sequence numbering of the tree nodes.
Having gaps in the tree greatly improves performance on all operations that add or remove tree nodes. Setting this to zero will leave no gaps in the tree. Setting this to a value larger than zero will create gaps in the tree. Each gap leaves room in the sequence numbering for the specified number of nodes. (The gap is expressed as the number of nodes. Since each node consumes two sequence numbers, specifying a gap of 1 will leave space for 2 sequence numbers.) A gap is created, when a new child is added to a node, and when not enough room between node.rgt and the child with the highest node.rgt value of the node is available. A gap is closed, when a node is removed and when (node.rgt - node.lft) is bigger than gap * 2.
Definition at line 114 of file class.ilTree.php.
Referenced by getGap().
|
protected |
Definition at line 121 of file class.ilTree.php.
|
protected |
Definition at line 124 of file class.ilTree.php.
|
private |
Definition at line 54 of file class.ilTree.php.
|
protected |
Definition at line 46 of file class.ilTree.php.
|
protected |
column name containing primary key in object table
Definition at line 89 of file class.ilTree.php.
Referenced by ilWorkspaceTree\lookupObjectId().
|
protected |
Definition at line 118 of file class.ilTree.php.
|
protected |
Definition at line 120 of file class.ilTree.php.
Referenced by getParentCache().
|
protected |
Definition at line 123 of file class.ilTree.php.
|
private |
Definition at line 128 of file class.ilTree.php.
|
protected |
column name containing primary key in reference table
Definition at line 84 of file class.ilTree.php.
Referenced by ilWorkspaceTree\lookupNodeId().
|
protected |
points to root node (may be a subtree)
Definition at line 59 of file class.ilTree.php.
|
protected |
table name of object_data table
Definition at line 74 of file class.ilTree.php.
Referenced by getObjectDataTable().
|
protected |
table name of object_reference table
Definition at line 79 of file class.ilTree.php.
Referenced by getTableReference().
|
protected |
table name of tree table
Definition at line 69 of file class.ilTree.php.
Referenced by getTreeTable().
|
protected |
Definition at line 122 of file class.ilTree.php.
|
protected |
to use different trees in one db-table
Definition at line 64 of file class.ilTree.php.
|
private |
Definition at line 126 of file class.ilTree.php.
Referenced by getTreeImplementation().
|
protected |
column name containing tree id in tree table
Definition at line 94 of file class.ilTree.php.
Referenced by getTreePk().
|
protected |
Definition at line 116 of file class.ilTree.php.
Referenced by isCacheUsed().
|
protected |
Definition at line 44 of file class.ilTree.php.
Referenced by __construct().
|
protected |
Definition at line 43 of file class.ilTree.php.
Referenced by __construct(), and initLangCode().
const ilTree::POS_FIRST_NODE = -1 |
Definition at line 35 of file class.ilTree.php.
Referenced by ilObjContentObjectGUI\confirmedDelete(), ILIAS\LearningModule\Editing\EditSubObjectsGUI\confirmedDelete(), ILIAS\LearningModule\Editing\EditSubObjectsGUI\delete(), ilObjContentObjectGUI\delete(), ILIAS\Skill\Node\SkillDeletionManager\deleteNode(), ilObjSkillTreeGUI\deleteNodes(), ILIAS\Skill\Node\SkillDeletionManager\deleteTree(), ILIAS\LearningModule\Editing\EditSubObjectsGUI\insertChapterBefore(), ILIAS\LearningModule\Editing\EditSubObjectsGUI\insertChapterClipBefore(), ilNestedSetTree\insertNode(), ILIAS\LearningModule\Editing\EditSubObjectsGUI\insertPageBefore(), ILIAS\LearningModule\Editing\EditSubObjectsGUI\insertPageClipBefore(), ILIAS\LearningModule\Editing\EditSubObjectsGUI\insertPageFromLayout(), ilObjContentObjectGUI\moveChapter(), ILIAS\Skill\Node\SkillTreeNodeManager\putIntoTree(), and ilLMObjectGUI\putInTree().
const ilTree::POS_LAST_NODE = -2 |
Definition at line 34 of file class.ilTree.php.
Referenced by ilLearningModuleDataSet\importRecord(), ILIAS\Skill\Node\SkillTreeNodeManager\insertItemsFromClip(), ilNestedSetTree\insertNode(), ilBasicSkillGUI\saveItem(), ilBasicSkillTemplateGUI\saveItem(), ilSkillCategoryGUI\saveItem(), ilSkillTemplateCategoryGUI\saveItem(), and ilSkillTemplateReferenceGUI\saveItem().
const ilTree::RELATION_CHILD = 1 |
Definition at line 37 of file class.ilTree.php.
Referenced by ilSoapUtils\findMappedReferenceForNode(), ilMaterializedPathTree\getRelation(), and ilNestedSetTree\getRelation().
const ilTree::RELATION_EQUALS = 4 |
Definition at line 40 of file class.ilTree.php.
Referenced by ilMaterializedPathTree\getRelation(), and ilNestedSetTree\getRelation().
const ilTree::RELATION_NONE = 5 |
Definition at line 41 of file class.ilTree.php.
Referenced by ilMaterializedPathTree\getRelation(), and ilNestedSetTree\getRelation().
const ilTree::RELATION_PARENT = 2 |
Definition at line 38 of file class.ilTree.php.
Referenced by ilMaterializedPathTree\getRelation(), ilNestedSetTree\getRelation(), and ilAdvancedMDRecord\isFilteredByScope().
const ilTree::RELATION_SIBLING = 3 |
Definition at line 39 of file class.ilTree.php.
Referenced by ilMaterializedPathTree\getRelation(), and ilNestedSetTree\getRelation().
const ilTree::TREE_TYPE_MATERIALIZED_PATH = 'mp' |
Definition at line 31 of file class.ilTree.php.
const ilTree::TREE_TYPE_NESTED_SET = 'ns' |
Definition at line 32 of file class.ilTree.php.