Method |
Description |
|
all ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection | static[] |
Get all of the nodes from the database. |
|
allLeaves ( ) : Builder |
Static query scope. Returns a query scope with all nodes which are at
the end of a branch. |
|
allTrunks ( ) : Builder |
Static query scope. Returns a query scope with all nodes which are at
the middle of a branch (not root and not leaves). |
|
ancestors ( ) : Builder |
Instance scope which targets all the ancestor chain nodes excluding
the current one. |
|
ancestorsAndSelf ( ) : Builder |
Instance scope which targes all the ancestor chain nodes including
the current one. |
|
buildTree ( $nodeList ) : boolean |
Maps the provided tree structure into the database. |
|
children ( ) : Illuminate\Database\Eloquent\Relations\HasMany |
Children relation (self-referential) 1-N. |
|
descendants ( ) : Builder |
Set of all children & nested children. |
|
descendantsAndSelf ( ) : Builder |
Scope targeting itself and all of its nested children. |
|
destroyDescendants ( ) : void; |
Prunes a branch off the tree, shifting all the elements on the right
back to the left so the counts work. |
|
equals ( $node ) : boolean |
Equals? |
|
getAncestors ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection |
Get all the ancestor chain from the database excluding the current node. |
|
getAncestorsAndSelf ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection |
Get all the ancestor chain from the database including the current node. |
|
getAncestorsAndSelfWithoutRoot ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection |
Get all the ancestor chain from the database including the current node
but without the root node. |
|
getAncestorsWithoutRoot ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection |
Get all the ancestor chain from the database excluding the current node
and the root node (from the current node's perspective). |
|
getDepth ( ) : integer |
Get the model's "depth" value. |
|
getDepthColumnName ( ) : string |
Get the "depth" field column name. |
|
getDescendants ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection |
Retrieve all of its children & nested children. |
|
getDescendantsAndSelf ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection |
Retrieve all nested children an self. |
|
getImmediateDescendants ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection |
Retrive all of its "immediate" descendants. |
|
getLeaves ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection |
Return all of its nested children which do not have children. |
|
getLeft ( ) : integer |
Get the value of the model's "left" field. |
|
getLeftColumnName ( ) : string |
Get the "left" field column name. |
|
getLeftSibling ( ) : NestedSet |
Returns the first sibling to the left. |
|
getLevel ( ) : integer |
Returns the level of this node in the tree. |
|
getNestedList ( $column, $key = null, $seperator = ' ' ) : array |
Return an key-value array indicating the node's depth with $seperator. |
|
getOrder ( ) : mixed |
Get the model's "order" value. |
|
getOrderColumnName ( ) : string |
Get the "order" field column name. |
|
getOthersAtSameDepth ( ) : Illuminate\Database\Eloquent\Collection |
Retrieve all other nodes at the same depth,. |
|
getParentColumnName ( ) : string |
Get the parent column name. |
|
getParentId ( ) : integer |
Get the value of the models "parent_id" field. |
|
getQualifiedDepthColumnName ( ) : string |
Get the table qualified "depth" field column name. |
|
getQualifiedLeftColumnName ( ) : string |
Get the table qualified "left" field column name. |
|
getQualifiedOrderColumnName ( ) : string |
Get the table qualified "order" field column name. |
|
getQualifiedParentColumnName ( ) : string |
Get the table qualified parent column name. |
|
getQualifiedRightColumnName ( ) : string |
Get the table qualified "right" field column name. |
|
getQualifiedScopedColumns ( ) : array |
Get the qualified column names which define our scope. |
|
getRight ( ) : integer |
Get the value of the model's "right" field. |
|
getRightColumnName ( ) : string |
Get the "right" field column name. |
|
getRightSibling ( ) : NestedSet |
Returns the first sibling to the right. |
|
getRoot ( ) : NestedSet |
Returns the root node starting at the current node. |
|
getScopedColumns ( ) : array |
Get the column names which define our scope. |
|
getSiblings ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection |
Return all children of the parent, except self. |
|
getSiblingsAndSelf ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection |
Get all children of the parent, including self. |
|
getTrunks ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection |
Return all of its nested children which are trunks. |
|
immediateDescendants ( ) : Builder |
Set of "immediate" descendants (aka children), alias for the children relation. |
|
inSameScope ( $other ) : boolean |
Checkes if the given node is in the same scope as the current one. |
|
insideSubtree ( $node ) : boolean |
Checks wether the given node is a descendant of itself. Basically, whether
its in the subtree defined by the left and right indices. |
|
isAncestorOf ( $other ) : boolean |
Returns true if node is an ancestor. |
|
isChild ( ) : boolean |
Returns true if this is a child node. |
|
isDescendantOf ( $other ) : boolean |
Returns true if node is a descendant. |
|
isLeaf ( ) : boolean |
Returns true if this is a leaf node (end of a branch). |
|
isRoot ( ) : boolean |
Returns true if this is a root node. |
|
isScoped ( ) : boolean |
Returns wether this particular node instance is scoped by certain fields
or not. |
|
isSelfOrAncestorOf ( $other ) : boolean |
Returns true if node is self or an ancestor. |
|
isSelfOrDescendantOf ( $other ) : boolean |
Returns true if node is self or a descendant. |
|
isTrunk ( ) : boolean |
Returns true if this is a trunk node (not root or leaf). |
|
isValidNestedSet ( ) : boolean |
Checks wether the underlying Nested Set structure is valid. |
|
leaves ( ) : Builder |
Instance scope targeting all of its nested children which do not have
children. |
|
makeChildOf ( $node ) : Node |
Make the node a child of . |
|
makeFirstChildOf ( $node ) : Node |
Make the node the first child of . |
|
makeLastChildOf ( $node ) : Node |
Make the node the last child of . |
|
makeNextSiblingOf ( $node ) : Node |
Alias for moveToRightOf. |
|
makePreviousSiblingOf ( $node ) : Node |
Alias for moveToLeftOf. |
|
makeRoot ( ) : Node |
Make current node a root node. |
|
makeSiblingOf ( $node ) : Node |
Alias for moveToRightOf. |
|
makeTree ( $nodeList ) : boolean |
Maps the provided tree structure into the database using the current node
as the parent. The provided tree structure will be inserted/updated as the
descendancy subtree of the current node instance. |
|
moveLeft ( ) : Node |
Find the left sibling and move to left of it. |
|
moveRight ( ) : Node |
Find the right sibling and move to the right of it. |
|
moveToLeftOf ( $node ) : Node |
Move to the node to the left of . |
|
moveToNewParent ( ) : void |
Move to the new parent if appropiate. |
|
moveToRightOf ( $node ) : Node |
Move to the node to the right of . |
|
newCollection ( array $models = [] ) : Collection |
Overload new Collection. |
|
newNestedSetQuery ( ) : Builder | static |
Get a new "scoped" query builder for the Node's model. |
|
parent ( ) : BelongsTo |
Parent relation (self-referential) 1-1. |
|
rebuild ( ) : void |
Rebuilds the structure of the current Nested Set. |
|
restoreDescendants ( ) : void |
Restores all of the current node's descendants. |
|
root ( ) : NestedSet |
Returns the first root node. |
|
roots ( ) : Builder |
Static query scope. Returns a query scope with all root nodes. |
|
scopeLimitDepth ( $query, $limit ) : Builder |
Provides a depth level limit for the query. |
|
scopeWithoutNode ( $query, $node ) : Builder |
Query scope which extracts a certain node object from the current query
expression. |
|
scopeWithoutRoot ( $query ) : Builder |
Extracts first root (from the current node p-o-v) from current query
expression. |
|
scopeWithoutSelf ( $query ) : Builder |
Extracts current node (self) from current query expression. |
|
setDefaultLeftAndRight ( ) : void |
Sets default values for left and right fields. |
|
setDepth ( ) : Node |
Sets the depth attribute. |
|
setDepthWithSubtree ( ) : Node |
Sets the depth attribute for the current node and all of its descendants. |
|
shiftSiblingsForRestore ( ) : void |
"Makes room" for the the current node between its siblings. |
|
siblings ( ) : Builder |
Instance scope targeting all children of the parent, except self. |
|
siblingsAndSelf ( ) : Builder |
Instance scope which targets all children of the parent, including self. |
|
storeNewParent ( ) : void |
Store the parent_id if the attribute is modified so as we are able to move
the node to this new parent after saving. |
|
trunks ( ) : Builder |
Instance scope targeting all of its nested children which are between the
root and the leaf nodes (middle branch). |
|