You are here

public function DefaultFileLocator::findMappingFile in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php \Doctrine\Common\Persistence\Mapping\Driver\DefaultFileLocator::findMappingFile()

Locates mapping file for the given class name.

Parameters

string $className:

Return value

string

Overrides FileLocator::findMappingFile

File

vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php, line 109

Class

DefaultFileLocator
Locates the file that contains the metadata information for a given class name.

Namespace

Doctrine\Common\Persistence\Mapping\Driver

Code

public function findMappingFile($className) {
  $fileName = str_replace('\\', '.', $className) . $this->fileExtension;

  // Check whether file exists
  foreach ($this->paths as $path) {
    if (is_file($path . DIRECTORY_SEPARATOR . $fileName)) {
      return $path . DIRECTORY_SEPARATOR . $fileName;
    }
  }
  throw MappingException::mappingFileNotFound($className, $fileName);
}