1
0
mirror of synced 2025-01-18 14:31:40 +03:00

[2.0] Changed init() to __construct().

This commit is contained in:
romanb 2009-08-04 09:33:36 +00:00
parent aa0792b166
commit e67b30703b
5 changed files with 9 additions and 10 deletions

View File

@ -21,10 +21,10 @@
namespace Doctrine\ORM\Query;
use Doctrine\Common\DoctrineException;
use Doctrine\ORM\Query;
use Doctrine\ORM\Query\AST;
use Doctrine\ORM\Query\Exec;
use Doctrine\Common\DoctrineException,
Doctrine\ORM\Query,
Doctrine\ORM\Query\AST,
Doctrine\ORM\Query\Exec;
/**
* 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
$treeWalker = $this->_treeWalker ?: new SqlWalker();
$treeWalker->init(
$treeWalker = $this->_treeWalker ?: new SqlWalker(
$this->_query, $this->_parserResult, $this->_queryComponents
);

View File

@ -74,7 +74,7 @@ class SqlWalker implements TreeWalker
/**
* @inheritdoc
*/
public function init($query, $parserResult, array $queryComponents)
public function __construct($query, $parserResult, array $queryComponents)
{
$this->_rsm = $parserResult->getResultSetMapping();
$this->_query = $query;

View File

@ -36,7 +36,7 @@ interface TreeWalker
* @param ParserResult $parserResult The result of the parsing process.
* @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.

View File

@ -33,7 +33,7 @@ abstract class TreeWalkerAdapter implements TreeWalker
/**
* @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.

View File

@ -48,7 +48,7 @@ class LanguageRecognitionTest extends \Doctrine\Tests\OrmTestCase
$parser = new \Doctrine\ORM\Query\Parser($query);
// 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();
}