src/Controller/ModelCollector.php
private function addParentFilter(ModelInterface $model, $config)
    {
        // Not hierarchical, nothing to do.
        if (BasicDefinitionInterface::MODE_HIERARCHICAL !== $this->definitionMode) {
            return;
        }

        // Root model?
        if ($this->isRootModel($model)) {
            $config->setFilter($this->rootCondition->getFilterArray());
            return;
        }

        // Determine the hard way now.
        $parent = $this->searchParentOf($model);

        if (!$parent instanceof ModelInterface) {
            throw new DcGeneralRuntimeException(
                'Parent could not be found, are the parent child conditions correct?'
            );
        }

        $condition = $this->relationships->getChildCondition($parent->getProviderName(), $model->getProviderName());
        $config->setFilter($condition->getFilter($parent));
    }
private function addParentFilter(ModelInterface $model, $config)
    {
        // Not hierarchical, nothing to do.
        if (BasicDefinitionInterface::MODE_HIERARCHICAL !== $this->definitionMode) {
            return;
        }

        // Root model?
        if ($this->isRootModel($model)) {
            $config->setFilter($this->rootCondition->getFilterArray());
            return;
        }

        // Determine the hard way now.
        $parent = $this->searchParentOf($model);

        if (!$parent instanceof ModelInterface) {
            throw new DcGeneralRuntimeException(
                'Parent could not be found, are the parent child conditions correct?'
            );
        }

        $condition = $this->relationships->getChildCondition($parent->getProviderName(), $model->getProviderName());
        $config->setFilter($condition->getFilter($parent));
    }
private function addParentFilter ( ModelInterface $ model , $ config ) { // Not hierarchical, nothing to do. if ( BasicDefinitionInterface :: MODE_HIERARCHICAL !== $ this -> definitionMode ) { return ; } // Root model? if ( $ this -> isRootModel ( $ model ) ) { $ config -> setFilter ( $ this -> rootCondition -> getFilterArray ( ) ) ; return ; } // Determine the hard way now. $ parent = $ this -> searchParentOf ( $ model ) ; if ( ! $ parent instanceof ModelInterface ) { throw new DcGeneralRuntimeException ( 'Parent could not be found, are the parent child conditions correct?' ) ; } $ condition = $ this -> relationships -> getChildCondition ( $ parent -> getProviderName ( ) , $ model -> getProviderName ( ) ) ; $ config -> setFilter ( $ condition -> getFilter ( $ parent ) ) ; }
Add the parent filter matching the parent of a model.

@param ModelInterface  $model  The model to search the parent for.
@param ConfigInterface $config The configuration to add the parent filter to.

@return void

@throws DcGeneralRuntimeException When parent could not be found.
Add the parent filter matching the parent of a model .