\Framework\UtilsTree

Summary

Methods
Properties
Constants
__construct()
getDescendant()
getTree()
arrayValues()
No public properties found
INCLUDE_ANCESTORS
EXCLUDE_ANCESTORS
getHashTree()
$data
$hashTree
$pidName
N/A
No private methods found
No private properties found
N/A

Constants

INCLUDE_ANCESTORS

INCLUDE_ANCESTORS = 1

获取完整的树结构,包含祖先节点

EXCLUDE_ANCESTORS

EXCLUDE_ANCESTORS = 0

获取部分树,不包含祖先节点

Properties

$data

$data : array

数据

Type

array

$hashTree

$hashTree : array

哈希树

Type

array

$pidName

$pidName : string

父级字段名

Type

string

Methods

__construct()

__construct( $data, \madong\helper\int|\madong\helper\string  $pid_name = 'pid') : mixed

Parameters

$data
\madong\helper\int|\madong\helper\string $pid_name

Returns

mixed —

getDescendant()

getDescendant(array  $include, bool  $with_self = false) : array

获取子孙节点

Parameters

array $include
bool $with_self

Returns

array —

getTree()

getTree(array  $include = [], int  $type = 1) : array|null

获取树

Parameters

array $include
int $type

Returns

array|null —

arrayValues()

arrayValues( $array) : array

递归重建数组下标

Parameters

$array

Returns

array —

getHashTree()

getHashTree(array  $data = []) : array

获取哈希树

Parameters

array $data

Returns

array —