src/BaseConfigRegistry.php
private function addParentFilter($idParent, $config)
    {
        $environment        = $this->getEnvironment();
        $definition         = $environment->getDataDefinition();
        $providerName       = $definition->getBasicDefinition()->getDataProvider();
        $parentProviderName = $idParent->getDataProviderName();
        $parentProvider     = $environment->getDataProvider($parentProviderName);

        if ($definition->getBasicDefinition()->getParentDataProvider() !== $parentProviderName) {
            throw new DcGeneralRuntimeException(
                'Unexpected parent provider ' . $parentProviderName .
                ' (expected ' . $definition->getBasicDefinition()->getParentDataProvider() . ')'
            );
        }

        if ($parentProvider) {
            $parent = $parentProvider->fetch($parentProvider->getEmptyConfig()->setId($idParent->getId()));
            if (!$parent) {
                throw new DcGeneralRuntimeException(
                    'Parent item ' . $idParent->getSerialized() . ' not found in ' . $parentProviderName
                );
            }

            $condition = $definition->getModelRelationshipDefinition()->getChildCondition(
                $parentProviderName,
                $providerName
            );

            if ($condition) {
                $baseFilter = $config->getFilter();
                $filter     = $condition->getFilter($parent);

                if ($baseFilter) {
                    $filter = \array_merge($baseFilter, $filter);
                }

                $config->setFilter([['operation' => 'AND', 'children'  => $filter]]);
            }
        }

        return $config;
    }
private function addParentFilter($idParent, $config)
    {
        $environment        = $this->getEnvironment();
        $definition         = $environment->getDataDefinition();
        $providerName       = $definition->getBasicDefinition()->getDataProvider();
        $parentProviderName = $idParent->getDataProviderName();
        $parentProvider     = $environment->getDataProvider($parentProviderName);

        if ($definition->getBasicDefinition()->getParentDataProvider() !== $parentProviderName) {
            throw new DcGeneralRuntimeException(
                'Unexpected parent provider ' . $parentProviderName .
                ' (expected ' . $definition->getBasicDefinition()->getParentDataProvider() . ')'
            );
        }

        if ($parentProvider) {
            $parent = $parentProvider->fetch($parentProvider->getEmptyConfig()->setId($idParent->getId()));
            if (!$parent) {
                throw new DcGeneralRuntimeException(
                    'Parent item ' . $idParent->getSerialized() . ' not found in ' . $parentProviderName
                );
            }

            $condition = $definition->getModelRelationshipDefinition()->getChildCondition(
                $parentProviderName,
                $providerName
            );

            if ($condition) {
                $baseFilter = $config->getFilter();
                $filter     = $condition->getFilter($parent);

                if ($baseFilter) {
                    $filter = \array_merge($baseFilter, $filter);
                }

                $config->setFilter([['operation' => 'AND', 'children'  => $filter]]);
            }
        }

        return $config;
    }
private function addParentFilter ( $ idParent , $ config ) { $ environment = $ this -> getEnvironment ( ) ; $ definition = $ environment -> getDataDefinition ( ) ; $ providerName = $ definition -> getBasicDefinition ( ) -> getDataProvider ( ) ; $ parentProviderName = $ idParent -> getDataProviderName ( ) ; $ parentProvider = $ environment -> getDataProvider ( $ parentProviderName ) ; if ( $ definition -> getBasicDefinition ( ) -> getParentDataProvider ( ) !== $ parentProviderName ) { throw new DcGeneralRuntimeException ( 'Unexpected parent provider ' . $ parentProviderName . ' (expected ' . $ definition -> getBasicDefinition ( ) -> getParentDataProvider ( ) . ')' ) ; } if ( $ parentProvider ) { $ parent = $ parentProvider -> fetch ( $ parentProvider -> getEmptyConfig ( ) -> setId ( $ idParent -> getId ( ) ) ) ; if ( ! $ parent ) { throw new DcGeneralRuntimeException ( 'Parent item ' . $ idParent -> getSerialized ( ) . ' not found in ' . $ parentProviderName ) ; } $ condition = $ definition -> getModelRelationshipDefinition ( ) -> getChildCondition ( $ parentProviderName , $ providerName ) ; if ( $ condition ) { $ baseFilter = $ config -> getFilter ( ) ; $ filter = $ condition -> getFilter ( $ parent ) ; if ( $ baseFilter ) { $ filter = \ array_merge ( $ baseFilter , $ filter ) ; } $ config -> setFilter ( [ [ 'operation' => 'AND' , 'children' => $ filter ] ] ) ; } } return $ config ; }
Add the filter for the item with the given id from the parent data provider to the given config.

@param ModelIdInterface $idParent The id of the parent item.
@param ConfigInterface  $config   The config to add the filter to.

@return ConfigInterface

@throws DcGeneralRuntimeException When the parent item is not found.
Add the filter for the item with the given id from the parent data provider to the given config .