1
0
mirror of synced 2025-02-21 22:53:15 +03:00

[DDC-490] Added extensibility support to Query Lexer.

This commit is contained in:
Guilherme Blanco 2010-07-26 01:24:46 -03:00
parent 17528224b9
commit b477211b4b
2 changed files with 13 additions and 3 deletions

View File

@ -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__;
}
}