public function configure(SimpleDoctrineMappingLocator $locator)
    {
        $path = $locator->getPaths()[0];

        $resourcePathExploded = explode('/', $path);
        $resourcePathRoot = array_shift($resourcePathExploded);

        if (strpos($resourcePathRoot, '@') === 0) {
            $mappingFileBundle = ltrim($resourcePathRoot, '@');
            $bundle = $this->kernel->getBundle($mappingFileBundle);

            if ($bundle instanceof BundleInterface) {
                $resourcePathRoot = $bundle->getPath();
            }
        }

        array_unshift($resourcePathExploded, $resourcePathRoot);

        $path = implode('/', $resourcePathExploded);

        if (!file_exists($path)) {
            throw new ConfigurationInvalidException('Mapping file "' . $path . '" does not exist');
        }

        $locator->setPaths([$path]);
    }
public function configure(SimpleDoctrineMappingLocator $locator)
    {
        $path = $locator->getPaths()[0];

        $resourcePathExploded = explode('/', $path);
        $resourcePathRoot = array_shift($resourcePathExploded);

        if (strpos($resourcePathRoot, '@') === 0) {
            $mappingFileBundle = ltrim($resourcePathRoot, '@');
            $bundle = $this->kernel->getBundle($mappingFileBundle);

            if ($bundle instanceof BundleInterface) {
                $resourcePathRoot = $bundle->getPath();
            }
        }

        array_unshift($resourcePathExploded, $resourcePathRoot);

        $path = implode('/', $resourcePathExploded);

        if (!file_exists($path)) {
            throw new ConfigurationInvalidException('Mapping file "' . $path . '" does not exist');
        }

        $locator->setPaths([$path]);
    }
public function configure ( SimpleDoctrineMappingLocator $ locator ) { $ path = $ locator -> getPaths ( ) [ 0 ] ; $ resourcePathExploded = explode ( '/' , $ path ) ; $ resourcePathRoot = array_shift ( $ resourcePathExploded ) ; if ( strpos ( $ resourcePathRoot , '@' ) === 0 ) { $ mappingFileBundle = ltrim ( $ resourcePathRoot , '@' ) ; $ bundle = $ this -> kernel -> getBundle ( $ mappingFileBundle ) ; if ( $ bundle instanceof BundleInterface ) { $ resourcePathRoot = $ bundle -> getPath ( ) ; } } array_unshift ( $ resourcePathExploded , $ resourcePathRoot ) ; $ path = implode ( '/' , $ resourcePathExploded ) ; if ( ! file_exists ( $ path ) ) { throw new ConfigurationInvalidException ( 'Mapping file "' . $ path . '" does not exist' ) ; } $ locator -> setPaths ( [ $ path ] ) ; }
If there is a parameter named like the driver locator path, replace it
with the value of such parameter.

@param SimpleDoctrineMappingLocator $locator Locator

@throws ConfigurationInvalidException Configuration invalid
If there is a parameter named like the driver locator path replace it with the value of such parameter .