Commit 77206615 authored by guilhermeblanco's avatar guilhermeblanco

[2.0] Implemented more TODO items in DQL Parser. Optimized PathExpression....

[2.0] Implemented more TODO items in DQL Parser. Optimized PathExpression. Changed wrong grammar rule name in EBNF.
parent 92214eaf
...@@ -3,14 +3,12 @@ ...@@ -3,14 +3,12 @@
namespace Doctrine\ORM\Query\AST; namespace Doctrine\ORM\Query\AST;
/** /**
* JoinAssociationPathExpression ::= JoinCollectionValuedPathExpression | JoinSingleValuedAssociationPathExpression * JoinAssociationPathExpression ::= IdentificationVariable "." (SingleValuedAssociationField | CollectionValuedAssociationField)
* JoinCollectionValuedPathExpression ::= IdentificationVariable "." CollectionValuedAssociationField
* JoinSingleValuedAssociationPathExpression ::= IdentificationVariable "." SingleValuedAssociationField
* *
* @author robo * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @todo Rename: JoinAssociationPathExpression * @author Roman Borschel
*/ */
class JoinPathExpression extends Node class JoinAssociationPathExpression extends Node
{ {
private $_identificationVariable; private $_identificationVariable;
private $_assocField; private $_assocField;
......
...@@ -26,18 +26,18 @@ namespace Doctrine\ORM\Query\AST; ...@@ -26,18 +26,18 @@ namespace Doctrine\ORM\Query\AST;
*/ */
class PathExpression extends Node class PathExpression extends Node
{ {
const TYPE_SINGLE_VALUED_PATH_EXPRESSION = 1;
const TYPE_COLLECTION_VALUED_ASSOCIATION = 2; const TYPE_COLLECTION_VALUED_ASSOCIATION = 2;
const TYPE_SINGLE_VALUED_ASSOCIATION = 4; const TYPE_SINGLE_VALUED_ASSOCIATION = 4;
const TYPE_STATE_FIELD = 8; const TYPE_STATE_FIELD = 8;
private $_type; private $_type;
private $_expectedType;
private $_identificationVariable; private $_identificationVariable;
private $_parts; private $_parts;
public function __construct($type, $identificationVariable, array $parts) public function __construct($expectedType, $identificationVariable, array $parts)
{ {
$this->_type = $type; $this->_expectedType = $expectedType;
$this->_identificationVariable = $identificationVariable; $this->_identificationVariable = $identificationVariable;
$this->_parts = $parts; $this->_parts = $parts;
} }
...@@ -52,6 +52,19 @@ class PathExpression extends Node ...@@ -52,6 +52,19 @@ class PathExpression extends Node
return $this->_parts; return $this->_parts;
} }
public function setExpectedType($type)
{
$this->_expectedType;
}
public function getExpectedType()
{
return $this->_expectedType;
}
/**
* INTERNAL
*/
public function setType($type) public function setType($type)
{ {
$this->_type = $type; $this->_type = $type;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment