PHP Class Xpressengine\Support\Tree\Tree

Author: XE Developers ([email protected])
Inheritance: implements ArrayAcces\ArrayAccess, implements JsonSerializabl\JsonSerializable
显示文件 Open project: xpressengine/xpressengine

Protected Properties

Property Type Description
$rawNodes Illuminate\Support\Collection NodeInterface[]
$treeNodes Illuminate\Support\Collection NodeInterface[]

Public Methods

Method Description
__construct ( Xpressengine\Support\Tree\NodeInterface[] $rawNodes = [] )
add ( Xpressengine\Support\Tree\NodeInterface $node ) Adds a node to this node
getNodes ( ) : Collection getRawNodes
getTreeNodes ( ) : Collection getTree
jsonSerialize ( ) : mixed (PHP 5 >= 5.4.0)
Specify data which should be serialized to JSON
make ( Xpressengine\Support\Tree\NodeInterface[] $rawNodes = [] ) : static Make Tree instance
offsetExists ( mixed $offset ) : boolean Implementation of ArrayAccess offsetExists() Whether a offset exists
offsetGet ( mixed $offset ) : mixed Implementation of ArrayAccess offsetGet() Offset to retrieve
offsetSet ( mixed $offset, mixed $value ) : void Implementation of ArrayAccess offsetSet() Offset to set
offsetUnset ( mixed $offset ) : void Implementation of ArrayAccess offsetUnset() Offset to unset
size ( ) : integer size of Tree Collection nodes

Protected Methods

Method Description
arrange ( ) : void Arrange From Raw nodes to Menu Tree nodes
fullSort ( array $items = [] ) : array sort all nodes
sort ( Xpressengine\Support\Tree\NodeInterface[] $items = [] ) : array sort node tree

Method Details

__construct() public method

public __construct ( Xpressengine\Support\Tree\NodeInterface[] $rawNodes = [] )
$rawNodes Xpressengine\Support\Tree\NodeInterface[] nodes

add() public method

Adds a node to this node
public add ( Xpressengine\Support\Tree\NodeInterface $node )
$node Xpressengine\Support\Tree\NodeInterface nodes

arrange() protected method

Arrange From Raw nodes to Menu Tree nodes
protected arrange ( ) : void
return void

fullSort() protected method

sort all nodes
protected fullSort ( array $items = [] ) : array
$items array nodes
return array

getNodes() public method

getRawNodes
public getNodes ( ) : Collection
return Illuminate\Support\Collection NodeInterface[]

getTreeNodes() public method

getTree
public getTreeNodes ( ) : Collection
return Illuminate\Support\Collection

jsonSerialize() public method

(PHP 5 >= 5.4.0)
Specify data which should be serialized to JSON
public jsonSerialize ( ) : mixed
return mixed data which can be serialized by json_encode, which is a value of any type other than a resource.

make() public static method

Make Tree instance
public static make ( Xpressengine\Support\Tree\NodeInterface[] $rawNodes = [] ) : static
$rawNodes Xpressengine\Support\Tree\NodeInterface[] nodes
return static

offsetExists() public method

Implementation of ArrayAccess offsetExists() Whether a offset exists
public offsetExists ( mixed $offset ) : boolean
$offset mixed array access offset
return boolean true on success or false on failure.

offsetGet() public method

Implementation of ArrayAccess offsetGet() Offset to retrieve
public offsetGet ( mixed $offset ) : mixed
$offset mixed array access offset
return mixed Can return all value types.

offsetSet() public method

Implementation of ArrayAccess offsetSet() Offset to set
public offsetSet ( mixed $offset, mixed $value ) : void
$offset mixed array access offset
$value mixed array access value
return void

offsetUnset() public method

Implementation of ArrayAccess offsetUnset() Offset to unset
public offsetUnset ( mixed $offset ) : void
$offset mixed array access offset
return void

size() public method

size of Tree Collection nodes
public size ( ) : integer
return integer

sort() protected method

sort node tree
protected sort ( Xpressengine\Support\Tree\NodeInterface[] $items = [] ) : array
$items Xpressengine\Support\Tree\NodeInterface[] nodes
return array

Property Details

$rawNodes protected_oe property

NodeInterface[]
protected Collection,Illuminate\Support $rawNodes
return Illuminate\Support\Collection

$treeNodes protected_oe property

NodeInterface[]
protected Collection,Illuminate\Support $treeNodes
return Illuminate\Support\Collection