PHP Class Baum\SetBuilder

Afficher le fichier Open project: gazsp/baum Class Usage Examples

Protected Properties

Свойство Type Description
$bounds array Array which will hold temporary lft, rgt index values for each scope.
$node Node Node instance for reference.

Méthodes publiques

Méthode Description
__construct ( Node $node ) : void Create a new \Baum\SetBuilder class instance.
children ( Baum\Node $node ) : Illuminate\Database\Eloquent\Collection Return all children for the specified node.
rebuild ( ) : void Perform the re-calculation of the left and right indexes of the whole nested set tree structure.
rebuildBounds ( $node, $depth ) Recompute left and right index bounds for the specified node and its children (recursive call). Fill the depth column too.
roots ( ) : Illuminate\Database\Eloquent\Collection Return all root nodes for the current database table appropiately sorted.

Méthodes protégées

Méthode Description
getNextBound ( string $key ) : integer Return next index bound value for the given key (current scope identifier).
qualify ( $column ) : string Get the fully qualified value for the specified column.
scopedAttributes ( Baum\Node $node ) : array Return an array of the scoped attributes of the supplied node.
scopedKey ( Baum\Node $node ) : string Return a string-key for the current scoped attributes. Used for index computing when a scope is defined (acsts as an scope identifier).

Method Details

__construct() public méthode

Create a new \Baum\SetBuilder class instance.
public __construct ( Node $node ) : void
$node Node
Résultat void

children() public méthode

Return all children for the specified node.
public children ( Baum\Node $node ) : Illuminate\Database\Eloquent\Collection
$node Baum\Node
Résultat Illuminate\Database\Eloquent\Collection

getNextBound() protected méthode

Return next index bound value for the given key (current scope identifier).
protected getNextBound ( string $key ) : integer
$key string
Résultat integer

qualify() protected méthode

Get the fully qualified value for the specified column.
protected qualify ( $column ) : string
Résultat string

rebuild() public méthode

Perform the re-calculation of the left and right indexes of the whole nested set tree structure.
public rebuild ( ) : void
Résultat void

rebuildBounds() public méthode

Recompute left and right index bounds for the specified node and its children (recursive call). Fill the depth column too.
public rebuildBounds ( $node, $depth )

roots() public méthode

Return all root nodes for the current database table appropiately sorted.
public roots ( ) : Illuminate\Database\Eloquent\Collection
Résultat Illuminate\Database\Eloquent\Collection

scopedAttributes() protected méthode

Return an array of the scoped attributes of the supplied node.
protected scopedAttributes ( Baum\Node $node ) : array
$node Baum\Node
Résultat array

scopedKey() protected méthode

Return a string-key for the current scoped attributes. Used for index computing when a scope is defined (acsts as an scope identifier).
protected scopedKey ( Baum\Node $node ) : string
$node Baum\Node
Résultat string

Property Details

$bounds protected_oe property

Array which will hold temporary lft, rgt index values for each scope.
protected array $bounds
Résultat array

$node protected_oe property

Node instance for reference.
protected Node,Baum $node
Résultat Node