PHP Класс Baum\Node

This abstract class implements Nested Set functionality. A Nested Set is a smart way to implement an ordered tree with the added benefit that you can select all of their descendants with a single query. Drawbacks are that insertion or move operations need more complex sql queries. Nested sets are appropiate when you want either an ordered tree (menus, commercial categories, etc.) or an efficient way of querying big trees.
Наследование: extends Baum\Extensions\Eloquent\Model
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$depthColumn string Column name for depth field.
$guarded array Guard NestedSet fields from mass-assignment.
$leftColumn string Column name for left index.
$moveToNewParentId integer Indicates whether we should move to a new parent.
$orderColumn string Column to perform the default sorting.
$parentColumn string Column name to store the reference to parent's node.
$rightColumn string Column name for right index.
$scoped array Columns which restrict what we consider our Nested Set list.

Открытые методы

Метод Описание
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).

Защищенные методы

Метод Описание
boot ( ) : void The "booting" method of the model.
computeLevel ( ) : integer Compute current node level. If could not move past ourseleves return our ancestor count, otherwhise get the first parent level + the computed nesting.
determineDepth ( Baum\Node $node, integer $nesting ) : array Return an array with the last node we could reach and its nesting level.
moveTo ( Baum\Node | integer $target, string $position ) : Node Main move method. Here we handle all node movements with the corresponding lft/rgt index updates.

Описание методов

all() публичный статический Метод

Get all of the nodes from the database.
public static all ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection | static[]
$columns array
Результат Illuminate\Database\Eloquent\Collection | static[]

allLeaves() публичный статический Метод

Static query scope. Returns a query scope with all nodes which are at the end of a branch.
public static allLeaves ( ) : Builder
Результат Illuminate\Database\Query\Builder

allTrunks() публичный статический Метод

Static query scope. Returns a query scope with all nodes which are at the middle of a branch (not root and not leaves).
public static allTrunks ( ) : Builder
Результат Illuminate\Database\Query\Builder

ancestors() публичный Метод

Instance scope which targets all the ancestor chain nodes excluding the current one.
public ancestors ( ) : Builder
Результат Illuminate\Database\Eloquent\Builder

ancestorsAndSelf() публичный Метод

Instance scope which targes all the ancestor chain nodes including the current one.
public ancestorsAndSelf ( ) : Builder
Результат Illuminate\Database\Eloquent\Builder

boot() защищенный статический Метод

We'll use this method to register event listeners on a Node instance as suggested in the beta documentation... TODO: - Find a way to avoid needing to declare the called methods "public" as registering the event listeners *inside* this methods does not give us an object context. Events: 1. "creating": Before creating a new Node we'll assign a default value for the left and right indexes. 2. "saving": Before saving, we'll perform a check to see if we have to move to another parent. 3. "saved": Move to the new parent after saving if needed and re-set depth. 4. "deleting": Before delete we should prune all children and update the left and right indexes for the remaining nodes. 5. (optional) "restoring": Before a soft-delete node restore operation, shift its siblings. 6. (optional) "restore": After having restored a soft-deleted node, restore all of its descendants.
protected static boot ( ) : void
Результат void

buildTree() публичный статический Метод

Maps the provided tree structure into the database.
public static buildTree ( $nodeList ) : boolean
Результат boolean

children() публичный Метод

Children relation (self-referential) 1-N.
public children ( ) : Illuminate\Database\Eloquent\Relations\HasMany
Результат Illuminate\Database\Eloquent\Relations\HasMany

computeLevel() защищенный Метод

Compute current node level. If could not move past ourseleves return our ancestor count, otherwhise get the first parent level + the computed nesting.
protected computeLevel ( ) : integer
Результат integer

descendants() публичный Метод

Set of all children & nested children.
public descendants ( ) : Builder
Результат Illuminate\Database\Query\Builder

descendantsAndSelf() публичный Метод

Scope targeting itself and all of its nested children.
public descendantsAndSelf ( ) : Builder
Результат Illuminate\Database\Query\Builder

destroyDescendants() публичный Метод

Prunes a branch off the tree, shifting all the elements on the right back to the left so the counts work.
public destroyDescendants ( ) : void;
Результат void;

determineDepth() защищенный Метод

Return an array with the last node we could reach and its nesting level.
protected determineDepth ( Baum\Node $node, integer $nesting ) : array
$node Baum\Node
$nesting integer
Результат array

equals() публичный Метод

Equals?
public equals ( $node ) : boolean
Результат boolean

getAncestors() публичный Метод

Get all the ancestor chain from the database excluding the current node.
public getAncestors ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection
$columns array
Результат Illuminate\Database\Eloquent\Collection

getAncestorsAndSelf() публичный Метод

Get all the ancestor chain from the database including the current node.
public getAncestorsAndSelf ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection
$columns array
Результат Illuminate\Database\Eloquent\Collection

getAncestorsAndSelfWithoutRoot() публичный Метод

Get all the ancestor chain from the database including the current node but without the root node.
public getAncestorsAndSelfWithoutRoot ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection
$columns array
Результат Illuminate\Database\Eloquent\Collection

getAncestorsWithoutRoot() публичный Метод

Get all the ancestor chain from the database excluding the current node and the root node (from the current node's perspective).
public getAncestorsWithoutRoot ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection
$columns array
Результат Illuminate\Database\Eloquent\Collection

getDepth() публичный Метод

Get the model's "depth" value.
public getDepth ( ) : integer
Результат integer

getDepthColumnName() публичный Метод

Get the "depth" field column name.
public getDepthColumnName ( ) : string
Результат string

getDescendants() публичный Метод

Retrieve all of its children & nested children.
public getDescendants ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection
$columns array
Результат Illuminate\Database\Eloquent\Collection

getDescendantsAndSelf() публичный Метод

Retrieve all nested children an self.
public getDescendantsAndSelf ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection
$columns array
Результат Illuminate\Database\Eloquent\Collection

getImmediateDescendants() публичный Метод

Retrive all of its "immediate" descendants.
public getImmediateDescendants ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection
$columns array
Результат Illuminate\Database\Eloquent\Collection

getLeaves() публичный Метод

Return all of its nested children which do not have children.
public getLeaves ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection
$columns array
Результат Illuminate\Database\Eloquent\Collection

getLeft() публичный Метод

Get the value of the model's "left" field.
public getLeft ( ) : integer
Результат integer

getLeftColumnName() публичный Метод

Get the "left" field column name.
public getLeftColumnName ( ) : string
Результат string

getLeftSibling() публичный Метод

Returns the first sibling to the left.
public getLeftSibling ( ) : NestedSet
Результат NestedSet

getLevel() публичный Метод

Root level is 0.
public getLevel ( ) : integer
Результат integer

getNestedList() публичный статический Метод

Return an key-value array indicating the node's depth with $seperator.
public static getNestedList ( $column, $key = null, $seperator = ' ' ) : array
Результат array

getOrder() публичный Метод

Get the model's "order" value.
public getOrder ( ) : mixed
Результат mixed

getOrderColumnName() публичный Метод

Get the "order" field column name.
public getOrderColumnName ( ) : string
Результат string

getOthersAtSameDepth() публичный Метод

Retrieve all other nodes at the same depth,.
public getOthersAtSameDepth ( ) : Illuminate\Database\Eloquent\Collection
Результат Illuminate\Database\Eloquent\Collection

getParentColumnName() публичный Метод

Get the parent column name.
public getParentColumnName ( ) : string
Результат string

getParentId() публичный Метод

Get the value of the models "parent_id" field.
public getParentId ( ) : integer
Результат integer

getQualifiedDepthColumnName() публичный Метод

Get the table qualified "depth" field column name.
public getQualifiedDepthColumnName ( ) : string
Результат string

getQualifiedLeftColumnName() публичный Метод

Get the table qualified "left" field column name.
public getQualifiedLeftColumnName ( ) : string
Результат string

getQualifiedOrderColumnName() публичный Метод

Get the table qualified "order" field column name.
public getQualifiedOrderColumnName ( ) : string
Результат string

getQualifiedParentColumnName() публичный Метод

Get the table qualified parent column name.
public getQualifiedParentColumnName ( ) : string
Результат string

getQualifiedRightColumnName() публичный Метод

Get the table qualified "right" field column name.
public getQualifiedRightColumnName ( ) : string
Результат string

getQualifiedScopedColumns() публичный Метод

Get the qualified column names which define our scope.
public getQualifiedScopedColumns ( ) : array
Результат array

getRight() публичный Метод

Get the value of the model's "right" field.
public getRight ( ) : integer
Результат integer

getRightColumnName() публичный Метод

Get the "right" field column name.
public getRightColumnName ( ) : string
Результат string

getRightSibling() публичный Метод

Returns the first sibling to the right.
public getRightSibling ( ) : NestedSet
Результат NestedSet

getRoot() публичный Метод

Returns the root node starting at the current node.
public getRoot ( ) : NestedSet
Результат NestedSet

getScopedColumns() публичный Метод

Get the column names which define our scope.
public getScopedColumns ( ) : array
Результат array

getSiblings() публичный Метод

Return all children of the parent, except self.
public getSiblings ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection
$columns array
Результат Illuminate\Database\Eloquent\Collection

getSiblingsAndSelf() публичный Метод

Get all children of the parent, including self.
public getSiblingsAndSelf ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection
$columns array
Результат Illuminate\Database\Eloquent\Collection

getTrunks() публичный Метод

Return all of its nested children which are trunks.
public getTrunks ( array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection
$columns array
Результат Illuminate\Database\Eloquent\Collection

immediateDescendants() публичный Метод

Set of "immediate" descendants (aka children), alias for the children relation.
public immediateDescendants ( ) : Builder
Результат Illuminate\Database\Query\Builder

inSameScope() публичный Метод

Checkes if the given node is in the same scope as the current one.
public inSameScope ( $other ) : boolean
Результат boolean

insideSubtree() публичный Метод

Checks wether the given node is a descendant of itself. Basically, whether its in the subtree defined by the left and right indices.
public insideSubtree ( $node ) : boolean
Результат boolean

isAncestorOf() публичный Метод

Returns true if node is an ancestor.
public isAncestorOf ( $other ) : boolean
Результат boolean

isChild() публичный Метод

Returns true if this is a child node.
public isChild ( ) : boolean
Результат boolean

isDescendantOf() публичный Метод

Returns true if node is a descendant.
public isDescendantOf ( $other ) : boolean
Результат boolean

isLeaf() публичный Метод

Returns true if this is a leaf node (end of a branch).
public isLeaf ( ) : boolean
Результат boolean

isRoot() публичный Метод

Returns true if this is a root node.
public isRoot ( ) : boolean
Результат boolean

isScoped() публичный Метод

Returns wether this particular node instance is scoped by certain fields or not.
public isScoped ( ) : boolean
Результат boolean

isSelfOrAncestorOf() публичный Метод

Returns true if node is self or an ancestor.
public isSelfOrAncestorOf ( $other ) : boolean
Результат boolean

isSelfOrDescendantOf() публичный Метод

Returns true if node is self or a descendant.
public isSelfOrDescendantOf ( $other ) : boolean
Результат boolean

isTrunk() публичный Метод

Returns true if this is a trunk node (not root or leaf).
public isTrunk ( ) : boolean
Результат boolean

isValidNestedSet() публичный статический Метод

Checks wether the underlying Nested Set structure is valid.
public static isValidNestedSet ( ) : boolean
Результат boolean

leaves() публичный Метод

Instance scope targeting all of its nested children which do not have children.
public leaves ( ) : Builder
Результат Illuminate\Database\Query\Builder

makeChildOf() публичный Метод

..
public makeChildOf ( $node ) : Node
Результат Node

makeFirstChildOf() публичный Метод

..
public makeFirstChildOf ( $node ) : Node
Результат Node

makeLastChildOf() публичный Метод

..
public makeLastChildOf ( $node ) : Node
Результат Node

makeNextSiblingOf() публичный Метод

Alias for moveToRightOf.
public makeNextSiblingOf ( $node ) : Node
Результат Node

makePreviousSiblingOf() публичный Метод

Alias for moveToLeftOf.
public makePreviousSiblingOf ( $node ) : Node
Результат Node

makeRoot() публичный Метод

Make current node a root node.
public makeRoot ( ) : Node
Результат Node

makeSiblingOf() публичный Метод

Alias for moveToRightOf.
public makeSiblingOf ( $node ) : Node
Результат Node

makeTree() публичный Метод

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.
public makeTree ( $nodeList ) : boolean
Результат boolean

moveLeft() публичный Метод

Find the left sibling and move to left of it.
public moveLeft ( ) : Node
Результат Node

moveRight() публичный Метод

Find the right sibling and move to the right of it.
public moveRight ( ) : Node
Результат Node

moveTo() защищенный Метод

Main move method. Here we handle all node movements with the corresponding lft/rgt index updates.
protected moveTo ( Baum\Node | integer $target, string $position ) : Node
$target Baum\Node | integer
$position string
Результат Node

moveToLeftOf() публичный Метод

..
public moveToLeftOf ( $node ) : Node
Результат Node

moveToNewParent() публичный Метод

Move to the new parent if appropiate.
public moveToNewParent ( ) : void
Результат void

moveToRightOf() публичный Метод

..
public moveToRightOf ( $node ) : Node
Результат Node

newCollection() публичный Метод

Overload new Collection.
public newCollection ( array $models = [] ) : Collection
$models array
Результат Baum\Extensions\Eloquent\Collection

newNestedSetQuery() публичный Метод

Get a new "scoped" query builder for the Node's model.
public newNestedSetQuery ( ) : Builder | static
Результат Illuminate\Database\Eloquent\Builder | static

parent() публичный Метод

Parent relation (self-referential) 1-1.
public parent ( ) : BelongsTo
Результат Illuminate\Database\Eloquent\Relations\BelongsTo

rebuild() публичный статический Метод

Rebuilds the structure of the current Nested Set.
public static rebuild ( ) : void
Результат void

restoreDescendants() публичный Метод

Restores all of the current node's descendants.
public restoreDescendants ( ) : void
Результат void

root() публичный статический Метод

Returns the first root node.
public static root ( ) : NestedSet
Результат NestedSet

roots() публичный статический Метод

Static query scope. Returns a query scope with all root nodes.
public static roots ( ) : Builder
Результат Illuminate\Database\Query\Builder

scopeLimitDepth() публичный Метод

Provides a depth level limit for the query.
public scopeLimitDepth ( $query, $limit ) : Builder
Результат Illuminate\Database\Query\Builder

scopeWithoutNode() публичный Метод

Query scope which extracts a certain node object from the current query expression.
public scopeWithoutNode ( $query, $node ) : Builder
Результат Illuminate\Database\Query\Builder

scopeWithoutRoot() публичный Метод

Extracts first root (from the current node p-o-v) from current query expression.
public scopeWithoutRoot ( $query ) : Builder
Результат Illuminate\Database\Query\Builder

scopeWithoutSelf() публичный Метод

Extracts current node (self) from current query expression.
public scopeWithoutSelf ( $query ) : Builder
Результат Illuminate\Database\Query\Builder

setDefaultLeftAndRight() публичный Метод

Sets default values for left and right fields.
public setDefaultLeftAndRight ( ) : void
Результат void

setDepth() публичный Метод

Sets the depth attribute.
public setDepth ( ) : Node
Результат Node

setDepthWithSubtree() публичный Метод

Sets the depth attribute for the current node and all of its descendants.
public setDepthWithSubtree ( ) : Node
Результат Node

shiftSiblingsForRestore() публичный Метод

"Makes room" for the the current node between its siblings.
public shiftSiblingsForRestore ( ) : void
Результат void

siblings() публичный Метод

Instance scope targeting all children of the parent, except self.
public siblings ( ) : Builder
Результат Illuminate\Database\Eloquent\Builder

siblingsAndSelf() публичный Метод

Instance scope which targets all children of the parent, including self.
public siblingsAndSelf ( ) : Builder
Результат Illuminate\Database\Eloquent\Builder

storeNewParent() публичный Метод

Store the parent_id if the attribute is modified so as we are able to move the node to this new parent after saving.
public storeNewParent ( ) : void
Результат void

trunks() публичный Метод

Instance scope targeting all of its nested children which are between the root and the leaf nodes (middle branch).
public trunks ( ) : Builder
Результат Illuminate\Database\Query\Builder

Описание свойств

$depthColumn защищенное свойство

Column name for depth field.
protected string $depthColumn
Результат string

$guarded защищенное свойство

Guard NestedSet fields from mass-assignment.
protected array $guarded
Результат array

$leftColumn защищенное свойство

Column name for left index.
protected string $leftColumn
Результат string

$moveToNewParentId защищенное статическое свойство

Indicates whether we should move to a new parent.
protected static int $moveToNewParentId
Результат integer

$orderColumn защищенное свойство

Column to perform the default sorting.
protected string $orderColumn
Результат string

$parentColumn защищенное свойство

Column name to store the reference to parent's node.
protected string $parentColumn
Результат string

$rightColumn защищенное свойство

Column name for right index.
protected string $rightColumn
Результат string

$scoped защищенное свойство

Columns which restrict what we consider our Nested Set list.
protected array $scoped
Результат array