. */ namespace Doctrine\ORM\Query\AST; /** * FromClause ::= "FROM" IdentificationVariableDeclaration {"," IdentificationVariableDeclaration} * * @author Guilherme Blanco * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://www.phpdoctrine.org * @since 2.0 * @version $Revision$ */ class FromClause extends Node { protected $_identificationVariableDeclarations = array(); public function __construct(array $identificationVariableDeclarations) { $this->_identificationVariableDeclarations = $identificationVariableDeclarations; } /* Getters */ public function getIdentificationVariableDeclarations() { return $this->_identificationVariableDeclarations; } /* REMOVE ME LATER. COPIED METHODS FROM SPLIT OF PRODUCTION INTO "AST" AND "PARSER" */ public function buildSql() { //echo "FromClause:\n"; //for ($i = 0; $i < count($this->_identificationVariableDeclaration);$i++) { // echo (($this->_identificationVariableDeclaration[$i] instanceof IdentificationVariableDeclaration) // ? get_class($this->_identificationVariableDeclaration[$i]) // : get_class($this->_identificationVariableDeclaration[$i])) . "\n"; //} return 'FROM ' . implode(', ', $this->_mapIdentificationVariableDeclarations()); } protected function _mapIdentificationVariableDeclarations() { return array_map( array(&$this, '_mapIdentificationVariableDeclaration'), $this->_identificationVariableDeclarations ); } protected function _mapIdentificationVariableDeclaration($value) { return $value->buildSql(); } }