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;
    }