[DDC-490] Added extensibility support to Query Lexer.
This commit is contained in:
parent
17528224b9
commit
b477211b4b
@ -151,7 +151,7 @@ class Lexer extends \Doctrine\Common\Lexer
|
||||
$value = str_replace("''", "'", substr($value, 1, strlen($value) - 2));
|
||||
return self::T_STRING;
|
||||
} else if (ctype_alpha($value[0]) || $value[0] === '_') {
|
||||
$name = 'Doctrine\ORM\Query\Lexer::T_' . strtoupper($value);
|
||||
$name = $this->getLexerClassName() . '::T_' . strtoupper($value);
|
||||
if (defined($name)) {
|
||||
$type = constant($name);
|
||||
if ($type > 100) {
|
||||
@ -185,4 +185,14 @@ class Lexer extends \Doctrine\Common\Lexer
|
||||
|
||||
return $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the class name (allows extensibility through Late Static Binding)
|
||||
*
|
||||
* @return string This class name
|
||||
*/
|
||||
protected function getLexerClassName()
|
||||
{
|
||||
return __CLASS__;
|
||||
}
|
||||
}
|
@ -760,7 +760,7 @@ class SqlWalker implements TreeWalker
|
||||
$joinTableAlias = $this->getSqlTableAlias($joinTable['name'], $joinedDqlAlias);
|
||||
$sql .= $assoc->getQuotedJoinTableName($this->_platform) . ' ' . $joinTableAlias . ' ON ';
|
||||
|
||||
$first = true;
|
||||
$first = true;
|
||||
if ($relation->isOwningSide) {
|
||||
foreach ($assoc->relationToSourceKeyColumns as $relationColumn => $sourceColumn) {
|
||||
if ( ! $first) $sql .= ' AND '; else $first = false;
|
||||
@ -784,7 +784,7 @@ class SqlWalker implements TreeWalker
|
||||
? ' LEFT JOIN ' : ' INNER JOIN ';
|
||||
$sql .= $targetTableName . ' ' . $targetTableAlias . ' ON ';
|
||||
|
||||
$first = true;
|
||||
$first = true;
|
||||
if ($relation->isOwningSide) {
|
||||
foreach ($assoc->relationToTargetKeyColumns as $relationColumn => $targetColumn) {
|
||||
if ( ! $first) $sql .= ' AND '; else $first = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user