Permalink
Browse files

Updated PoC for multiple components DQL support.

  • Loading branch information...
1 parent e7dfa08 commit 41a650b699f2761b7b43c51d47d2c060c6004b0a @guilhermeblanco guilhermeblanco committed with beberlei Jun 10, 2012
View
@@ -24,4 +24,9 @@ Also, related functions were affected:
* iterate($parameters, $hydrationMode) the argument $parameters can be either an key=>value array or an ArrayCollection instance
* setParameters($parameters) the argument $parameters can be either an key=>value array or an ArrayCollection instance
* getParameters() now returns ArrayCollection instead of array
-* getParameter($key) now returns Parameter instance instead of parameter value
+* getParameter($key) now returns Parameter instance instead of parameter value
+
+# Query TreeWalker method renamed
+
+Internal changes were made to DQL and SQL generation. If you have implemented your own TreeWalker,
+you probably need to update it. The method walkJoinVariableDeclaration is now named walkJoin.
@@ -36,13 +36,13 @@ class IdentificationVariableDeclaration extends Node
{
public $rangeVariableDeclaration = null;
public $indexBy = null;
- public $joinVariableDeclarations = array();
+ public $joins = array();
- public function __construct($rangeVariableDecl, $indexBy, array $joinVariableDecls)
+ public function __construct($rangeVariableDecl, $indexBy, array $joins)
{
$this->rangeVariableDeclaration = $rangeVariableDecl;
$this->indexBy = $indexBy;
- $this->joinVariableDeclarations = $joinVariableDecls;
+ $this->joins = $joins;
}
public function dispatch($sqlWalker)
@@ -25,28 +25,26 @@
* Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN" JoinAssociationPathExpression
* ["AS"] AliasIdentificationVariable [("ON" | "WITH") ConditionalExpression]
*
- *
* @link www.doctrine-project.org
* @since 2.0
- * @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class Join extends Node
{
- const JOIN_TYPE_LEFT = 1;
+ const JOIN_TYPE_LEFT = 1;
const JOIN_TYPE_LEFTOUTER = 2;
- const JOIN_TYPE_INNER = 3;
+ const JOIN_TYPE_INNER = 3;
public $joinType = self::JOIN_TYPE_INNER;
- public $joinPathExpression = null;
+ public $joinAssociationDeclaration = null;
public $conditionalExpression = null;
- public function __construct($joinType, $joinPathExpr)
+ public function __construct($joinType, $joinAssociationDeclaration)
{
$this->joinType = $joinType;
- $this->joinAssociationPathExpression = $joinPathExpr;
+ $this->joinAssociationDeclaration = $joinAssociationDeclaration;
}
public function dispatch($sqlWalker)
@@ -15,36 +15,39 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
+<<<<<<< HEAD:lib/Doctrine/ORM/Query/AST/JoinVariableDeclaration.php
* and is licensed under the MIT license. For more information, see
* <http://www.phpdoctrine.org>.
+=======
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+>>>>>>> Updated PoC for multiple components DQL support.:lib/Doctrine/ORM/Query/AST/JoinAssociationDeclaration.php
@yethee

yethee Jun 18, 2012

Contributor

Artifact of merge

*/
namespace Doctrine\ORM\Query\AST;
/**
- * JoinVariableDeclaration ::= Join [IndexBy]
+ * JoinAssociationDeclaration ::= JoinAssociationPathExpression ["AS"] AliasIdentificationVariable
*
- *
* @link www.doctrine-project.org
- * @since 2.0
- * @version $Revision: 3938 $
+ * @since 2.3
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
*/
-class JoinVariableDeclaration extends Node
+class JoinAssociationDeclaration extends Node
{
- public $join = null;
- public $indexBy = null;
+ public $joinAssociationPathExpression;
+ public $aliasIdentificationVariable;
+ public $indexBy;
- public function __construct($join, $indexBy)
+ public function __construct($joinAssociationPathExpression, $aliasIdentificationVariable, $indexBy)
{
- $this->join = $join;
- $this->indexBy = $indexBy;
+ $this->joinAssociationPathExpression = $joinAssociationPathExpression;
+ $this->aliasIdentificationVariable = $aliasIdentificationVariable;
+ $this->indexBy = $indexBy;
}
public function dispatch($sqlWalker)
{
- return $sqlWalker->walkJoinVariableDeclaration($this);
+ return $sqlWalker->walkJoinAssociationDeclaration($this);
}
}
@@ -24,10 +24,8 @@
/**
* JoinAssociationPathExpression ::= IdentificationVariable "." (SingleValuedAssociationField | CollectionValuedAssociationField)
*
- *
* @link www.doctrine-project.org
* @since 2.0
- * @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
@@ -36,17 +34,15 @@ class JoinAssociationPathExpression extends Node
{
public $identificationVariable;
public $associationField;
- public $aliasIdentificationVariable = null;
- public function __construct($identificationVariable, $associationField, $aliasIdentVar)
+ public function __construct($identificationVariable, $associationField)
{
$this->identificationVariable = $identificationVariable;
- $this->associationField = $associationField;
- $this->aliasIdentificationVariable = $aliasIdentVar;
+ $this->associationField = $associationField;
}
public function dispatch($sqlWalker)
{
- return $sqlWalker->walkJoinPathExpression($this);
+ return $sqlWalker->walkPathExpression($this);
}
}
Oops, something went wrong.

0 comments on commit 41a650b

Please sign in to comment.