Methods summary
public
boolean
|
#
hasMaster( )
Determine if this object has a direct parent.
Determine if this object has a direct parent.
Returns
boolean
|
public
boolean
|
#
isTopLevel( )
Determine if this object is the head (top-level) of its hierarchy.
Determine if this object is the head (top-level) of its hierarchy.
Top-level objects do not have a parent (master).
Returns
boolean
|
public
boolean
|
#
isLastLevel( )
Determine if this object is the tail (last-level) of its hierarchy.
Determine if this object is the tail (last-level) of its hierarchy.
Last-level objects do not have a children.
Returns
boolean
|
public
integer
|
#
hierarchyLevel( )
Retrieve this object's position (level) in its hierarchy.
Retrieve this object's position (level) in its hierarchy.
Starts at "1" (top-level).
Returns
integer
|
public
Charcoal\Object\HierarchicalInterface |null
|
#
master( )
Retrieve this object's immediate parent.
Retrieve this object's immediate parent.
Returns
|
public
Charcoal\Object\HierarchicalInterface |null
|
#
toplevelMaster( )
Retrieve the top-level ancestor of this object.
Retrieve the top-level ancestor of this object.
Returns
|
public
boolean
|
#
hasParents( )
Determine if this object has any ancestors.
Determine if this object has any ancestors.
Returns
boolean
|
public
array
|
#
hierarchy( )
Retrieve this object's ancestors (from immediate parent to top-level).
Retrieve this object's ancestors (from immediate parent to top-level).
Returns
array
|
public
array
|
#
invertedHierarchy( )
Retrieve this object's ancestors, inverted from top-level to immediate.
Retrieve this object's ancestors, inverted from top-level to immediate.
Returns
array
|
public
boolean
|
#
isMasterOf( mixed $child )
Determine if the object is the parent of the given object.
Determine if the object is the parent of the given object.
Parameters
- $child
- The child (or ID) to match against.
Returns
boolean
|
public
boolean
|
#
recursiveIsMasterOf( mixed $child )
Determine if the object is a parent/ancestor of the given object.
Determine if the object is a parent/ancestor of the given object.
Parameters
- $child
- The child (or ID) to match against.
Returns
boolean
|
public
boolean
|
#
hasChildren( )
Get wether the object has any children at all
Get wether the object has any children at all
Returns
boolean
|
public
integer
|
#
numChildren( )
Get the number of chidlren directly under this object.
Get the number of chidlren directly under this object.
Returns
integer
|
public
integer
|
#
recursiveNumChildren( )
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.
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
|
public
array
|
#
children( )
Get the children directly under this object.
Get the children directly under this object.
Returns
array
|
public
boolean
|
#
isChildOf( mixed $master )
Parameters
- $master
- The master object (or ident) to check against.
Returns
boolean The master object (or ident) to check against.
|
public
boolean
|
#
recursiveIsChildOf( mixed $master )
Parameters
- $master
- The master object (or ident) to check against.
Returns
boolean
|
public
boolean
|
|
public
integer
|
|
public
array
|
#
siblings( )
Get all the objects on the same level as this one.
Get all the objects on the same level as this one.
Returns
array
|
public
boolean
|
#
isSiblingOf( mixed $sibling )
Parameters
- $sibling
- The sibling object (or ident) to check against.
Returns
boolean
|