private function prepareFilterForRootCondition()
    {
        $environment   = $this->getEnvironment();
        $rootCondition = $environment->getDataDefinition()->getModelRelationshipDefinition()->getRootCondition();

        $baseConfig = $environment->getBaseConfigRegistry()->getBaseConfig();
        if (!$rootCondition) {
            return $baseConfig;
        }

        $baseFilter = $baseConfig->getFilter();
        $filter     = $rootCondition->getFilterArray();

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

        $baseConfig->setFilter($filter);

        return $baseConfig;
    }