. */ /** * RangeVariableDeclaration ::= AbstractSchemaName ["AS"] AliasIdentificationVariable * * @author Guilherme Blanco * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://www.phpdoctrine.org * @since 2.0 * @version $Revision$ */ class Doctrine_ORM_Query_AST_RangeVariableDeclaration extends Doctrine_ORM_Query_AST { private $_classMetadata; private $_abstractSchemaName; private $_aliasIdentificationVariable; public function __construct($classMetadata, $aliasIdentificationVar) { $this->_classMetadata = $classMetadata; $this->_abstractSchemaName = $classMetadata->getClassName(); $this->_aliasIdentificationVariable = $aliasIdentificationVar; } /* Getters */ public function getAbstractSchemaName() { return $this->_abstractSchemaName; } public function getAliasIdentificationVariable() { return $this->_aliasIdentificationVariable; } public function getClassMetadata() { return $this->_classMetadata; } /* REMOVE ME LATER. COPIED METHODS FROM SPLIT OF PRODUCTION INTO "AST" AND "PARSER" */ public function buildSql() { // Retrieving connection $conn = $this->_parserResult->getEntityManager()->getConnection(); // Component alias $componentAlias = $this->_aliasIdentificationVariable; // Retrieving required information try { $queryComponent = $this->_parserResult->getQueryComponent($componentAlias); $classMetadata = $queryComponent['metadata']; } catch (Doctrine_Exception $e) { $this->_parser->semanticalError($e->getMessage()); return; } return $conn->quoteIdentifier($classMetadata->getTableName()) . ' ' . $conn->quoteIdentifier($this->_parserResult->getTableAliasFromComponentAlias($componentAlias)); } }