. */ /** * 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 $_AST = null; public function syntax() { // AbstractSchemaName ::= identifier $this->_AST = $this->AST('AbstractSchemaName'); $this->_parser->match(Doctrine_ORM_Query_Token::T_IDENTIFIER); $this->_AST->setComponentName($this->_parser->token['value']); } public function semantical() { $componentName = $this->_AST->getComponentName(); // Check if we are dealing with a real Doctrine_Entity or not if ( ! $this->_isDoctrineEntity($componentName)) { $this->_parser->semanticalError( "Defined entity '" . $componentName . "' is not a valid entity." ); } // Return AST node return $this->_AST; } protected function _isDoctrineEntity($componentName) { return class_exists($componentName)/* && class_implements($componentName, 'Doctrine_ORM_Entity')*/; } }