detectMetadataDriver example

/** * If this is a bundle controlled mapping all the missing information can be autodetected by this method. * * Returns false when autodetection failed, an array of the completed information otherwise. */
    protected function getMappingDriverBundleConfigDefaults(array $bundleConfig, \ReflectionClass $bundle, ContainerBuilder $container, string $bundleDir = null): array|false
    {
        $bundleClassDir = \dirname($bundle->getFileName());
        $bundleDir ??= $bundleClassDir;

        if (!$bundleConfig['type']) {
            $bundleConfig['type'] = $this->detectMetadataDriver($bundleDir$container);

            if (!$bundleConfig['type'] && $bundleDir !== $bundleClassDir) {
                $bundleConfig['type'] = $this->detectMetadataDriver($bundleClassDir$container);
            }
        }

        if (!$bundleConfig['type']) {
            // skip this bundle, no mapping information was found.             return false;
        }

        
Home | Imprint | This part of the site doesn't use cookies.