FastTree
in package
Table of Contents
- $db : mixed
- $spacer : mixed
- $table : mixed
- $tree_id : mixed
- __construct() : mixed
- FastTree constructor.
- _getLeftAndRightIds() : array<string|int, mixed>|bool
- _rebuildTree() : bool
- _setupTree() : bool
- add() : bool
- MPTT + Gap add function.
- delete() : bool
- edit() : bool
- FormatArray() : array<string|int, mixed>|bool
- FormatFlexArray() : array<string|int, mixed>
- Flex requires that all index keys start at 0, even in the children section, So we need to handle that as well so Flex doesn't need any post processing.
- getAllChildren() : array<string|int, mixed>|bool
- getAllParents() : bool
- getChild() : bool
- getLeftId() : bool
- getLevel() : bool
- getNode() : bool
- getParentId() : bool
- getRightId() : bool
- getRootId() : mixed
- getTree() : int
- insertGaps() : bool
- move() : bool
- rebuildTree() : bool
- setTree() : bool
- getListSQL() : string
Properties
$db
public
mixed
$db
= \null
$spacer
public
mixed
$spacer
= 0
$table
public
mixed
$table
= 'fast_tree'
$tree_id
public
mixed
$tree_id
= 0
Methods
__construct()
FastTree constructor.
public
__construct([null $options = null ]) : mixed
Parameters
- $options : null = null
Return values
mixed —_getLeftAndRightIds()
public
_getLeftAndRightIds(string $parent_id) : array<string|int, mixed>|bool
Parameters
- $parent_id : string
-
UUID
Return values
array<string|int, mixed>|bool —_rebuildTree()
public
_rebuildTree(string $object_id, string $left_id) : bool
Parameters
- $object_id : string
-
UUID
- $left_id : string
-
UUID
Return values
bool —_setupTree()
public
_setupTree() : bool
Return values
bool —add()
MPTT + Gap add function.
public
add(string $object_id, int $parent_id) : bool
Parameters
- $object_id : string
-
UUID
- $parent_id : int
Return values
bool —delete()
public
delete(string $object_id[, bool $recurse = false ]) : bool
Parameters
- $object_id : string
-
UUID
- $recurse : bool = false
Return values
bool —edit()
public
edit(string $object_id, string $new_object_id) : bool
Parameters
- $object_id : string
-
UUID
- $new_object_id : string
-
UUID
Return values
bool —FormatArray()
public
static FormatArray( $nodes[, string $type = 'HTML' ][, bool $include_root = false ]) : array<string|int, mixed>|bool
Parameters
Return values
array<string|int, mixed>|bool —FormatFlexArray()
Flex requires that all index keys start at 0, even in the children section, So we need to handle that as well so Flex doesn't need any post processing.
public
static FormatFlexArray( $nodes[, bool $include_root = true ]) : array<string|int, mixed>
Parameters
Return values
array<string|int, mixed> —getAllChildren()
public
getAllChildren([string|bool $object_id = null ][, bool $recurse = false ], int $data_format) : array<string|int, mixed>|bool
Parameters
- $object_id : string|bool = null
-
UUID
- $recurse : bool = false
- $data_format : int
Return values
array<string|int, mixed>|bool —getAllParents()
public
getAllParents(string $object_id) : bool
Parameters
- $object_id : string
-
UUID
Return values
bool —getChild()
public
getChild(string $object_id) : bool
Parameters
- $object_id : string
-
UUID
Return values
bool —getLeftId()
public
getLeftId(string $object_id) : bool
Parameters
- $object_id : string
-
UUID
Return values
bool —getLevel()
public
getLevel(string $object_id) : bool
Parameters
- $object_id : string
-
UUID
Return values
bool —getNode()
public
getNode(string $object_id) : bool
Parameters
- $object_id : string
-
UUID
Return values
bool —getParentId()
public
getParentId(string $object_id) : bool
Parameters
- $object_id : string
-
UUID
Return values
bool —getRightId()
public
getRightId(string $object_id) : bool
Parameters
- $object_id : string
-
UUID
Return values
bool —getRootId()
public
getRootId() : mixed
Return values
mixed —getTree()
public
getTree() : int
Return values
int —insertGaps()
public
insertGaps(string $parent_id) : bool
Parameters
- $parent_id : string
-
UUID
Return values
bool —move()
public
move(string $object_id, string $parent_id) : bool
Parameters
- $object_id : string
-
UUID
- $parent_id : string
-
UUID
Return values
bool —rebuildTree()
public
rebuildTree([bool $object_id = false ]) : bool
Parameters
- $object_id : bool = false
Return values
bool —setTree()
public
setTree(string $id) : bool
Parameters
- $id : string
-
UUID
Return values
bool —getListSQL()
protected
getListSQL( $array[, null &$ph = null ]) : string