. */ namespace Doctrine\ORM\Mapping\Driver; use Doctrine\Common\Cache\ArrayCache, Doctrine\Common\Annotations\AnnotationReader, Doctrine\DBAL\Schema\AbstractSchemaManager, Doctrine\ORM\Mapping\ClassMetadataInfo, Doctrine\ORM\Mapping\MappingException, Doctrine\Common\Util\Inflector, Doctrine\ORM\Mapping\Driver\AbstractFileDriver; /** * The PHPDriver includes php files which just populate ClassMetadataInfo * 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 { /** * {@inheritdoc} */ protected $_fileExtension = '.php'; protected $_metadata; /** * {@inheritdoc} */ public function loadMetadataForClass($className, ClassMetadataInfo $metadata) { $this->_metadata = $metadata; $this->_loadMappingFile($this->_findMappingFile($className)); } /** * {@inheritdoc} */ protected function _loadMappingFile($file) { $metadata = $this->_metadata; include $file; } }