src/Controller/ModelCollector.php
private function searchParentOfInHierarchical(ModelInterface $model)
    {
        if ($this->isRootModel($model)) {
            throw new DcGeneralInvalidArgumentException('Invalid condition, root models can not have parents!');
        }
        // Start from the root data provider and walk through the whole tree.
        // To speed up, some conditions have an inverse filter - we should use them!
        $config = $this->rootProvider->getEmptyConfig()->setFilter($this->rootCondition->getFilterArray());

        return $this->searchParentOfIn($model, $this->rootProvider->fetchAll($config));
    }
private function searchParentOfInHierarchical(ModelInterface $model)
    {
        if ($this->isRootModel($model)) {
            throw new DcGeneralInvalidArgumentException('Invalid condition, root models can not have parents!');
        }
        // Start from the root data provider and walk through the whole tree.
        // To speed up, some conditions have an inverse filter - we should use them!
        $config = $this->rootProvider->getEmptyConfig()->setFilter($this->rootCondition->getFilterArray());

        return $this->searchParentOfIn($model, $this->rootProvider->fetchAll($config));
    }
private function searchParentOfInHierarchical ( ModelInterface $ model ) { if ( $ this -> isRootModel ( $ model ) ) { throw new DcGeneralInvalidArgumentException ( 'Invalid condition, root models can not have parents!' ) ; } // Start from the root data provider and walk through the whole tree. // To speed up, some conditions have an inverse filter - we should use them! $ config = $ this -> rootProvider -> getEmptyConfig ( ) -> setFilter ( $ this -> rootCondition -> getFilterArray ( ) ) ; return $ this -> searchParentOfIn ( $ model , $ this -> rootProvider -> fetchAll ( $ config ) ) ; }
Search the parent of a model in hierarchical mode.

@param ModelInterface $model The model to search the parent of.

@return ModelInterface|null

@throws DcGeneralInvalidArgumentException When a root model has been passed.
Search the parent of a model in hierarchical mode .