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
파일 보기 프로젝트 열기: gazsp/baum 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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.

getQualifiedLeftColumnName() 공개 메소드

Get the table qualified "left" field column name.

getQualifiedOrderColumnName() 공개 메소드

Get the table qualified "order" field column name.

getQualifiedParentColumnName() 공개 메소드

Get the table qualified parent column name.

getQualifiedRightColumnName() 공개 메소드

Get the table qualified "right" field column name.

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