src/Contao/Dca/Builder/Legacy/ExtendedLegacyDcaDataDefinitionBuilder.php
protected function loadAdditionalDefinitions(ContainerInterface $container)
    {
        if (null !== $this->getFromDca('dca_config/data_provider')) {
            $dataContainerName = $container->getName();
            $this->getDispatcher()->addListener(
                PopulateEnvironmentEvent::NAME,
                function (PopulateEnvironmentEvent $event) use ($dataContainerName) {
                    $environment = $event->getEnvironment();
                    $definition  = $environment->getDataDefinition();
                    if ($definition->getName() !== $dataContainerName) {
                        return;
                    }

                    $parentName = $definition->getBasicDefinition()->getParentDataProvider();
                    if ($parentName) {
                        if ($parentName === $definition->getName()) {
                            $parentDefinition = $definition;
                        } else {
                            $parentDefinition = (new DcGeneralFactory())
                                ->setEventDispatcher($environment->getEventDispatcher())
                                ->setTranslator($environment->getTranslator())
                                ->setContainerName($parentName)
                                ->createDcGeneral()
                                ->getEnvironment()
                                ->getDataDefinition();
                        }
                        $environment->setParentDataDefinition($parentDefinition);
                    }

                    $rootName = $definition->getBasicDefinition()->getRootDataProvider();
                    if ($rootName) {
                        if ($rootName === $definition->getName()) {
                            $rootDefinition = $definition;
                        } else {
                            $rootDefinition = (new DcGeneralFactory())
                                ->setEventDispatcher($environment->getEventDispatcher())
                                ->setTranslator($environment->getTranslator())
                                ->setContainerName($rootName)
                                ->createDcGeneral()
                                ->getEnvironment()
                                ->getDataDefinition();
                        }

                        $environment->setRootDataDefinition($rootDefinition);
                    }
                }
            );
        }
    }
protected function loadAdditionalDefinitions(ContainerInterface $container)
    {
        if (null !== $this->getFromDca('dca_config/data_provider')) {
            $dataContainerName = $container->getName();
            $this->getDispatcher()->addListener(
                PopulateEnvironmentEvent::NAME,
                function (PopulateEnvironmentEvent $event) use ($dataContainerName) {
                    $environment = $event->getEnvironment();
                    $definition  = $environment->getDataDefinition();
                    if ($definition->getName() !== $dataContainerName) {
                        return;
                    }

                    $parentName = $definition->getBasicDefinition()->getParentDataProvider();
                    if ($parentName) {
                        if ($parentName === $definition->getName()) {
                            $parentDefinition = $definition;
                        } else {
                            $parentDefinition = (new DcGeneralFactory())
                                ->setEventDispatcher($environment->getEventDispatcher())
                                ->setTranslator($environment->getTranslator())
                                ->setContainerName($parentName)
                                ->createDcGeneral()
                                ->getEnvironment()
                                ->getDataDefinition();
                        }
                        $environment->setParentDataDefinition($parentDefinition);
                    }

                    $rootName = $definition->getBasicDefinition()->getRootDataProvider();
                    if ($rootName) {
                        if ($rootName === $definition->getName()) {
                            $rootDefinition = $definition;
                        } else {
                            $rootDefinition = (new DcGeneralFactory())
                                ->setEventDispatcher($environment->getEventDispatcher())
                                ->setTranslator($environment->getTranslator())
                                ->setContainerName($rootName)
                                ->createDcGeneral()
                                ->getEnvironment()
                                ->getDataDefinition();
                        }

                        $environment->setRootDataDefinition($rootDefinition);
                    }
                }
            );
        }
    }
protected function loadAdditionalDefinitions ( ContainerInterface $ container ) { if ( null !== $ this -> getFromDca ( 'dca_config/data_provider' ) ) { $ dataContainerName = $ container -> getName ( ) ; $ this -> getDispatcher ( ) -> addListener ( PopulateEnvironmentEvent :: NAME , function ( PopulateEnvironmentEvent $ event ) use ( $ dataContainerName ) { $ environment = $ event -> getEnvironment ( ) ; $ definition = $ environment -> getDataDefinition ( ) ; if ( $ definition -> getName ( ) !== $ dataContainerName ) { return ; } $ parentName = $ definition -> getBasicDefinition ( ) -> getParentDataProvider ( ) ; if ( $ parentName ) { if ( $ parentName === $ definition -> getName ( ) ) { $ parentDefinition = $ definition ; } else { $ parentDefinition = ( new DcGeneralFactory ( ) ) -> setEventDispatcher ( $ environment -> getEventDispatcher ( ) ) -> setTranslator ( $ environment -> getTranslator ( ) ) -> setContainerName ( $ parentName ) -> createDcGeneral ( ) -> getEnvironment ( ) -> getDataDefinition ( ) ; } $ environment -> setParentDataDefinition ( $ parentDefinition ) ; } $ rootName = $ definition -> getBasicDefinition ( ) -> getRootDataProvider ( ) ; if ( $ rootName ) { if ( $ rootName === $ definition -> getName ( ) ) { $ rootDefinition = $ definition ; } else { $ rootDefinition = ( new DcGeneralFactory ( ) ) -> setEventDispatcher ( $ environment -> getEventDispatcher ( ) ) -> setTranslator ( $ environment -> getTranslator ( ) ) -> setContainerName ( $ rootName ) -> createDcGeneral ( ) -> getEnvironment ( ) -> getDataDefinition ( ) ; } $ environment -> setRootDataDefinition ( $ rootDefinition ) ; } } ) ; } }
Load all additional definitions, like naming of parent data provider etc.

@param ContainerInterface $container The container where the data shall be stored.

@return void
Load all additional definitions like naming of parent data provider etc .