Methods

hasMaster()

hasMaster() : boolean

Determine if this object has a direct parent.

Returns

boolean

isTopLevel()

isTopLevel() : boolean

Determine if this object is the head (top-level) of its hierarchy.

Top-level objects do not have a parent (master).

Returns

boolean

isLastLevel()

isLastLevel() : boolean

Determine if this object is the tail (last-level) of its hierarchy.

Last-level objects do not have a children.

Returns

boolean

hierarchyLevel()

hierarchyLevel() : integer

Retrieve this object's position (level) in its hierarchy.

Starts at "1" (top-level).

Returns

integer

hasParents()

hasParents() : boolean

Determine if this object has any ancestors.

Returns

boolean

hierarchy()

hierarchy() : array

Retrieve this object's ancestors (from immediate parent to top-level).

Returns

array

invertedHierarchy()

invertedHierarchy() : array

Retrieve this object's ancestors, inverted from top-level to immediate.

Returns

array

isMasterOf()

isMasterOf(mixed  $child) : boolean

Determine if the object is the parent of the given object.

Parameters

mixed $child

The child (or ID) to match against.

Returns

boolean

recursiveIsMasterOf()

recursiveIsMasterOf(mixed  $child) : boolean

Determine if the object is a parent/ancestor of the given object.

Parameters

mixed $child

The child (or ID) to match against.

Returns

boolean

hasChildren()

hasChildren() : boolean

Get wether the object has any children at all

Returns

boolean

numChildren()

numChildren() : integer

Get the number of chidlren directly under this object.

Returns

integer

recursiveNumChildren()

recursiveNumChildren() : integer

Get the total number of children in the entire hierarchy.

This method counts all children and sub-children, unlike numChildren() which only count 1 level.

Returns

integer

children()

children() : array

Get the children directly under this object.

Returns

array

isChildOf()

isChildOf(mixed  $master) : boolean

Parameters

mixed $master

The master object (or ident) to check against.

Returns

boolean —

The master object (or ident) to check against.

recursiveIsChildOf()

recursiveIsChildOf(mixed  $master) : boolean

Parameters

mixed $master

The master object (or ident) to check against.

Returns

boolean

hasSiblings()

hasSiblings() : boolean

Returns

boolean

numSiblings()

numSiblings() : integer

Returns

integer

siblings()

siblings() : array

Get all the objects on the same level as this one.

Returns

array

isSiblingOf()

isSiblingOf(mixed  $sibling) : boolean

Parameters

mixed $sibling

The sibling object (or ident) to check against.

Returns

boolean