src/Contao/Dca/Builder/Legacy/ExtendedLegacyDcaDataDefinitionBuilder.php
protected function parseSingleDataProvider(
        ContainerInterface $container,
        DataProviderDefinitionInterface $providers,
        array $information,
        $name
    ) {
        if (isset($information['factory'])) {
            $providerInformation = (new \ReflectionClass($information['factory']))->newInstance()->build($information);
        } else {
            // Determine the name.
            if ($name && !$this->isSpecialName($name)) {
                $providerName = $name;
            } elseif ('default' === $name) {
                $providerName = $container->getName();
            } elseif (isset($information['source'])) {
                $providerName = $information['source'];
            } else {
                $providerName = $container->getName();
            }

            // Check config if it already exists, if not, add it.
            if (!$providers->hasInformation($providerName)) {
                $providerInformation = new ContaoDataProviderInformation();
                $providerInformation->setName($providerName);
                $providers->addInformation($providerInformation);
            } else {
                $providerInformation = $providers->getInformation($providerName);
            }

            if (!$providerInformation->getTableName()) {
                if (isset($information['source'])) {
                    $providerInformation
                        ->setTableName($information['source']);
                } else {
                    $providerInformation
                        ->setTableName($providerName);
                }
            }

            if (isset($information['class'])) {
                $providerInformation->setClassName($information['class']);
            }
        }

        return $providerInformation;
    }
protected function parseSingleDataProvider(
        ContainerInterface $container,
        DataProviderDefinitionInterface $providers,
        array $information,
        $name
    ) {
        if (isset($information['factory'])) {
            $providerInformation = (new \ReflectionClass($information['factory']))->newInstance()->build($information);
        } else {
            // Determine the name.
            if ($name && !$this->isSpecialName($name)) {
                $providerName = $name;
            } elseif ('default' === $name) {
                $providerName = $container->getName();
            } elseif (isset($information['source'])) {
                $providerName = $information['source'];
            } else {
                $providerName = $container->getName();
            }

            // Check config if it already exists, if not, add it.
            if (!$providers->hasInformation($providerName)) {
                $providerInformation = new ContaoDataProviderInformation();
                $providerInformation->setName($providerName);
                $providers->addInformation($providerInformation);
            } else {
                $providerInformation = $providers->getInformation($providerName);
            }

            if (!$providerInformation->getTableName()) {
                if (isset($information['source'])) {
                    $providerInformation
                        ->setTableName($information['source']);
                } else {
                    $providerInformation
                        ->setTableName($providerName);
                }
            }

            if (isset($information['class'])) {
                $providerInformation->setClassName($information['class']);
            }
        }

        return $providerInformation;
    }
protected function parseSingleDataProvider ( ContainerInterface $ container , DataProviderDefinitionInterface $ providers , array $ information , $ name ) { if ( isset ( $ information [ 'factory' ] ) ) { $ providerInformation = ( new \ ReflectionClass ( $ information [ 'factory' ] ) ) -> newInstance ( ) -> build ( $ information ) ; } else { // Determine the name. if ( $ name && ! $ this -> isSpecialName ( $ name ) ) { $ providerName = $ name ; } elseif ( 'default' === $ name ) { $ providerName = $ container -> getName ( ) ; } elseif ( isset ( $ information [ 'source' ] ) ) { $ providerName = $ information [ 'source' ] ; } else { $ providerName = $ container -> getName ( ) ; } // Check config if it already exists, if not, add it. if ( ! $ providers -> hasInformation ( $ providerName ) ) { $ providerInformation = new ContaoDataProviderInformation ( ) ; $ providerInformation -> setName ( $ providerName ) ; $ providers -> addInformation ( $ providerInformation ) ; } else { $ providerInformation = $ providers -> getInformation ( $ providerName ) ; } if ( ! $ providerInformation -> getTableName ( ) ) { if ( isset ( $ information [ 'source' ] ) ) { $ providerInformation -> setTableName ( $ information [ 'source' ] ) ; } else { $ providerInformation -> setTableName ( $ providerName ) ; } } if ( isset ( $ information [ 'class' ] ) ) { $ providerInformation -> setClassName ( $ information [ 'class' ] ) ; } } return $ providerInformation ; }
Parse a single data provider information and prepare the definition object for it.

@param ContainerInterface              $container   The container where the data shall be stored.
@param DataProviderDefinitionInterface $providers   The data provider container.
@param array                           $information The information for the data provider to be parsed.
@param string|null                     $name        The name of the data provider to be used within the
container.

@return ContaoDataProviderInformation|null
Parse a single data provider information and prepare the definition object for it .