PHP 클래스 Baum\SetValidator

파일 보기 프로젝트 열기: gazsp/baum 1 사용 예제들

보호된 프로퍼티들

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