You are here

public function FileDriver::getElement in Zircon Profile 8.0

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

Gets 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.

Parameters

string $className:

Return value

array The element of schema meta data.

Throws

MappingException

File

vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php, line 105

Class

FileDriver
Base driver for file-based metadata drivers.

Namespace

Doctrine\Common\Persistence\Mapping\Driver

Code

public function getElement($className) {
  if ($this->classCache === null) {
    $this
      ->initialize();
  }
  if (isset($this->classCache[$className])) {
    return $this->classCache[$className];
  }
  $result = $this
    ->loadMappingFile($this->locator
    ->findMappingFile($className));
  if (!isset($result[$className])) {
    throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className) . $this->locator
      ->getFileExtension());
  }
  return $result[$className];
}