PHP Класс Baum\SetValidator

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$node Node Node instance for reference.

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

Метод Описание
__construct ( Node $node ) : void Create a new \Baum\SetValidator class instance.
fails ( ) : boolean Determine if validation fails.
passes ( ) : boolean Determine if the validation passes.

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

Метод Описание
duplicatesExistForColumn ( string $column ) : boolean Checks if duplicate values for the column specified exist. Takes the Nested Set scope columns into account (if appropiate).
groupRootsByScope ( mixed $roots ) : array Given a list of root nodes, it returns an array in which the keys are the array of the actual scope column values and the values are the root nodes inside that scope themselves.
isEachRootValid ( mixed $roots ) : boolean Check that each root node in the list supplied satisfies that its bounds values (lft, rgt indexes) are less than the next.
keyForScope ( Baum\Node $node ) : string Builds a single string for the given scope columns values. Useful for making array keys for grouping.
validateBounds ( ) : boolean Validates bounds of the nested tree structure. It will perform checks on the lft, rgt and parent_id columns. Mainly that they're not null, rights greater than lefts, and that they're within the bounds of the parent.
validateDuplicates ( ) : boolean Checks that there are no duplicates for the lft and rgt columns.
validateRoots ( ) : boolean For each root of the whole nested set tree structure, checks that their lft and rgt bounds are properly set.
validateRootsByScope ( mixed $roots ) : boolean Check that each root node in the list supplied satisfies that its bounds values (lft, rgt indexes) are less than the next *within each scope*.

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

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

Create a new \Baum\SetValidator class instance.
public __construct ( Node $node ) : void
$node Node
Результат void

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

Checks if duplicate values for the column specified exist. Takes the Nested Set scope columns into account (if appropiate).
protected duplicatesExistForColumn ( string $column ) : boolean
$column string
Результат boolean

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

Determine if validation fails.
public fails ( ) : boolean
Результат boolean

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

Given a list of root nodes, it returns an array in which the keys are the array of the actual scope column values and the values are the root nodes inside that scope themselves.
protected groupRootsByScope ( mixed $roots ) : array
$roots mixed
Результат array

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

Check that each root node in the list supplied satisfies that its bounds values (lft, rgt indexes) are less than the next.
protected isEachRootValid ( mixed $roots ) : boolean
$roots mixed
Результат boolean

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

Builds a single string for the given scope columns values. Useful for making array keys for grouping.
protected keyForScope ( Baum\Node $node ) : string
$node Baum\Node
Результат string

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

Determine if the validation passes.
public passes ( ) : boolean
Результат boolean

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

Validates bounds of the nested tree structure. It will perform checks on the lft, rgt and parent_id columns. Mainly that they're not null, rights greater than lefts, and that they're within the bounds of the parent.
protected validateBounds ( ) : boolean
Результат boolean

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

Checks that there are no duplicates for the lft and rgt columns.
protected validateDuplicates ( ) : boolean
Результат boolean

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

For each root of the whole nested set tree structure, checks that their lft and rgt bounds are properly set.
protected validateRoots ( ) : boolean
Результат boolean

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

Check that each root node in the list supplied satisfies that its bounds values (lft, rgt indexes) are less than the next *within each scope*.
protected validateRootsByScope ( mixed $roots ) : boolean
$roots mixed
Результат boolean

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

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

Node instance for reference.
protected Node,Baum $node
Результат Node