public function andRootIs(Page $root)
    {
        if (!$root->isRoot()) {
            throw new \InvalidArgumentException('Provided page is not a tree root.');
        }

        $suffix = $this->getSuffix();
        return $this->andWhere($this->getSectionAlias().'._root = :root'.$suffix)
                        ->setParameter('root'.$suffix, $root->getSection());
    }
public function andRootIs(Page $root)
    {
        if (!$root->isRoot()) {
            throw new \InvalidArgumentException('Provided page is not a tree root.');
        }

        $suffix = $this->getSuffix();
        return $this->andWhere($this->getSectionAlias().'._root = :root'.$suffix)
                        ->setParameter('root'.$suffix, $root->getSection());
    }
public function andRootIs ( Page $ root ) { if ( ! $ root -> isRoot ( ) ) { throw new \ InvalidArgumentException ( 'Provided page is not a tree root.' ) ; } $ suffix = $ this -> getSuffix ( ) ; return $ this -> andWhere ( $ this -> getSectionAlias ( ) . '._root = :root' . $ suffix ) -> setParameter ( 'root' . $ suffix , $ root -> getSection ( ) ) ; }
Add query part to select pages from their tree root.

@param  Page                 $root               The root page to check

@return PageQueryBuilder

@throws \InvalidArgumentException                Raises if $root is not a tree root
Add query part to select pages from their tree root .