. */ namespace Doctrine\ORM\Mapping\Driver; use Doctrine\Common\Cache\ArrayCache, Doctrine\Common\Annotations\AnnotationReader, Doctrine\DBAL\Schema\AbstractSchemaManager, Doctrine\Common\Persistence\Mapping\ClassMetadata, Doctrine\ORM\Mapping\MappingException, Doctrine\Common\Util\Inflector, Doctrine\ORM\Mapping\Driver\AbstractFileDriver; /** * The PHPDriver includes php files which just populate ClassMetadata * instances with plain php code * * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link www.doctrine-project.org * @since 2.0 * @version $Revision$ * @author Benjamin Eberlei * @author Guilherme Blanco * @author Jonathan H. Wage * @author Roman Borschel * @todo Rename: PHPDriver */ class PHPDriver extends AbstractFileDriver { const DEFAULT_FILE_EXTENSION = '.php'; /** * {@inheritdoc} */ protected $_fileExtension = '.php'; protected $_metadata; /** * {@inheritdoc} */ public function __construct($locator, $fileExtension = self::DEFAULT_FILE_EXTENSION) { parent::__construct($locator, $fileExtension); } /** * {@inheritdoc} */ public function loadMetadataForClass($className, ClassMetadata $metadata) { $this->_metadata = $metadata; $this->loadMappingFile($this->findMappingFile($className)); } /** * {@inheritdoc} */ protected function loadMappingFile($file) { $metadata = $this->_metadata; include $file; } }