Baum\SetValidator::isEachRootValid PHP Method

isEachRootValid() protected method

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
return boolean
    protected function isEachRootValid($roots)
    {
        $left = $right = 0;
        foreach ($roots as $root) {
            $rootLeft = $root->getLeft();
            $rootRight = $root->getRight();
            if (!($rootLeft > $left && $rootRight > $right)) {
                return false;
            }
            $left = $rootLeft;
            $right = $rootRight;
        }
        return true;
    }