tree_interface
interface tree_interface
Methods
Inserts an item into the database table and into the tree.
Delete an item from the tree and from the database table
Move an item by a given delta
Move an item down by 1
Move an item up by 1
Moves all children of one item to another item
Change parent item
Get all items that are either ancestors or descendants of the item
Get all of the item's ancestors
Get all of the item's descendants
Details
at line 24
array
insert(array $additional_data)
Inserts an item into the database table and into the tree.
at line 34
array
delete(int $item_id)
Delete an item from the tree and from the database table
Also deletes the subtree from the tree and from the database table
at line 47
bool
move(int $item_id, int $delta)
Move an item by a given delta
An item is only moved up/down within the same parent. If the delta is larger then the number of children, the item is moved to the top/bottom of the list of children within this parent.
at line 55
bool
move_down(int $item_id)
Move an item down by 1
at line 63
bool
move_up(int $item_id)
Move an item up by 1
at line 75
bool
move_children(int $current_parent_id, int $new_parent_id)
Moves all children of one item to another item
If the new parent already has children, the new children are appended to the list.
at line 86
bool
change_parent(int $item_id, int $new_parent_id)
Change parent item
Moves the item to the bottom of the new \parent's list of children
at line 97
array
get_path_and_subtree_data(int $item_id, bool $order_asc, bool $include_item)
Get all items that are either ancestors or descendants of the item
at line 108
array
get_path_data(int $item_id, bool $order_asc, bool $include_item)
Get all of the item's ancestors
at line 119
array
get_subtree_data(int $item_id, bool $order_asc, bool $include_item)
Get all of the item's descendants