1
0
mirror of synced 2025-02-20 22:23:14 +03:00

Emulating feature that has to be moved to Doctrine\Common

This commit is contained in:
Marco Pivetta 2012-01-17 13:55:42 +01:00
parent e9f23d51e0
commit bb998d1738

View File

@ -60,6 +60,23 @@ abstract class AbstractFileDriver extends FileDriver implements Driver
return $this->locator->getPaths();
}
/**
* Get the element of schema meta data for the class from the mapping file.
* This will lazily load the mapping file if it is not loaded yet
*
* @return array $element The element of schema meta data
* @throws MappingException
* @todo move behavior to FileDriver
*/
public function getElement($className)
{
$result = parent::getElement($className);
if($result === null) {
throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className) . $this->locator->getFileExtension());
}
return $result;
}
/**
* Finds the mapping file for the class with the given name by searching
* through the configured paths.