[2.0] Added support to complex PathExpression in DQL queries
This commit is contained in:
parent
3928ba9dac
commit
2195894ad3
@ -94,13 +94,6 @@ class Parser
|
|||||||
*/
|
*/
|
||||||
private $_em;
|
private $_em;
|
||||||
|
|
||||||
/**
|
|
||||||
* The Abtract Syntax Tree of processed DQL query.
|
|
||||||
*
|
|
||||||
* @var SelectStatement | UpdateStatement | DeleteStatement
|
|
||||||
*/
|
|
||||||
private $_ast;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Query to parse.
|
* The Query to parse.
|
||||||
*
|
*
|
||||||
@ -201,16 +194,6 @@ class Parser
|
|||||||
return $this->_em;
|
return $this->_em;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the Abstract Syntax Tree generated by the parser.
|
|
||||||
*
|
|
||||||
* @return SelectStatement | UpdateStatement | DeleteStatement
|
|
||||||
*/
|
|
||||||
public function getAST()
|
|
||||||
{
|
|
||||||
return $this->_ast;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers a custom function that returns strings.
|
* Registers a custom function that returns strings.
|
||||||
*
|
*
|
||||||
|
@ -59,25 +59,6 @@ class LanguageRecognitionTest extends \Doctrine\Tests\OrmTestCase
|
|||||||
return $parser->parse();
|
return $parser->parse();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function parseDqlForAST($dql, $hints = array())
|
|
||||||
{
|
|
||||||
$query = $this->_em->createQuery($dql);
|
|
||||||
$query->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true);
|
|
||||||
$query->setDql($dql);
|
|
||||||
|
|
||||||
foreach ($hints as $key => $value) {
|
|
||||||
$query->setHint($key, $value);
|
|
||||||
}
|
|
||||||
|
|
||||||
$parser = new \Doctrine\ORM\Query\Parser($query);
|
|
||||||
// We do NOT test SQL output here. That only unnecessarily slows down the tests!
|
|
||||||
$parser->setCustomOutputTreeWalker('Doctrine\Tests\Mocks\MockTreeWalker');
|
|
||||||
$parser->parse();
|
|
||||||
|
|
||||||
return $parser->getAST();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function testEmptyQueryString()
|
public function testEmptyQueryString()
|
||||||
{
|
{
|
||||||
$this->assertInvalidDql('');
|
$this->assertInvalidDql('');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user