[2.0] Changed init() to __construct().
This commit is contained in:
parent
aa0792b166
commit
e67b30703b
@ -21,10 +21,10 @@
|
|||||||
|
|
||||||
namespace Doctrine\ORM\Query;
|
namespace Doctrine\ORM\Query;
|
||||||
|
|
||||||
use Doctrine\Common\DoctrineException;
|
use Doctrine\Common\DoctrineException,
|
||||||
use Doctrine\ORM\Query;
|
Doctrine\ORM\Query,
|
||||||
use Doctrine\ORM\Query\AST;
|
Doctrine\ORM\Query\AST,
|
||||||
use Doctrine\ORM\Query\Exec;
|
Doctrine\ORM\Query\Exec;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An LL(*) parser for the context-free grammar of the Doctrine Query Language.
|
* An LL(*) parser for the context-free grammar of the Doctrine Query Language.
|
||||||
@ -257,8 +257,7 @@ class Parser
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create TreeWalker who creates the SQL from the AST
|
// Create TreeWalker who creates the SQL from the AST
|
||||||
$treeWalker = $this->_treeWalker ?: new SqlWalker();
|
$treeWalker = $this->_treeWalker ?: new SqlWalker(
|
||||||
$treeWalker->init(
|
|
||||||
$this->_query, $this->_parserResult, $this->_queryComponents
|
$this->_query, $this->_parserResult, $this->_queryComponents
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ class SqlWalker implements TreeWalker
|
|||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
public function init($query, $parserResult, array $queryComponents)
|
public function __construct($query, $parserResult, array $queryComponents)
|
||||||
{
|
{
|
||||||
$this->_rsm = $parserResult->getResultSetMapping();
|
$this->_rsm = $parserResult->getResultSetMapping();
|
||||||
$this->_query = $query;
|
$this->_query = $query;
|
||||||
|
@ -36,7 +36,7 @@ interface TreeWalker
|
|||||||
* @param ParserResult $parserResult The result of the parsing process.
|
* @param ParserResult $parserResult The result of the parsing process.
|
||||||
* @param array $queryComponents Query components (symbol table)
|
* @param array $queryComponents Query components (symbol table)
|
||||||
*/
|
*/
|
||||||
function init($query, $parserResult, array $queryComponents);
|
function __construct($query, $parserResult, array $queryComponents);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Walks down a SelectStatement AST node, thereby generating the appropriate SQL.
|
* Walks down a SelectStatement AST node, thereby generating the appropriate SQL.
|
||||||
|
@ -33,7 +33,7 @@ abstract class TreeWalkerAdapter implements TreeWalker
|
|||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
public function init($query, $parserResult, array $queryComponents) {}
|
public function __construct($query, $parserResult, array $queryComponents) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Walks down a SelectStatement AST node, thereby generating the appropriate SQL.
|
* Walks down a SelectStatement AST node, thereby generating the appropriate SQL.
|
||||||
|
@ -48,7 +48,7 @@ class LanguageRecognitionTest extends \Doctrine\Tests\OrmTestCase
|
|||||||
|
|
||||||
$parser = new \Doctrine\ORM\Query\Parser($query);
|
$parser = new \Doctrine\ORM\Query\Parser($query);
|
||||||
// We do NOT test SQL construction here. That only unnecessarily slows down the tests!
|
// We do NOT test SQL construction here. That only unnecessarily slows down the tests!
|
||||||
$parser->setTreeWalker(new \Doctrine\Tests\Mocks\MockTreeWalker);
|
$parser->setTreeWalker(new \Doctrine\Tests\Mocks\MockTreeWalker(null, null, array()));
|
||||||
|
|
||||||
return $parser->parse();
|
return $parser->parse();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user