. */ /** * AbstractSchemaName ::= identifier * * @author Guilherme Blanco * @author Janne Vanhala * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://www.phpdoctrine.org * @since 2.0 * @version $Revision$ */ class Doctrine_ORM_Query_Parser_AbstractSchemaName extends Doctrine_ORM_Query_ParserRule { protected $_componentName = null; public function syntax() { // AbstractSchemaName ::= identifier $this->_parser->match(Doctrine_ORM_Query_Token::T_IDENTIFIER); $this->_componentName = $this->_parser->token['value']; } public function semantical() { // Check if we are dealing with a real Doctrine_Entity or not if ( ! $this->_isDoctrineEntity($this->_componentName)) { $this->_parser->semanticalError( "Defined entity '" . $this->_componentName . "' is not a valid entity." ); } // Return Component Name identifier return $this->_componentName; } protected function _isDoctrineEntity($componentName) { return class_exists($componentName)/* && class_implements($componentName, 'Doctrine_ORM_Entity')*/; } }