mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
optimize query for person
This commit is contained in:
@@ -21,20 +21,15 @@ namespace Chill\MainBundle\Doctrine\DQL;
|
||||
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
|
||||
use Doctrine\ORM\Query\Lexer;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
class Similarity extends FunctionNode
|
||||
{
|
||||
private $firstPart;
|
||||
|
||||
|
||||
private $secondPart;
|
||||
|
||||
|
||||
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
|
||||
{
|
||||
return 'SIMILARITY('.$this->firstPart->dispatch($sqlWalker).
|
||||
return 'SIMILARITY('.$this->firstPart->dispatch($sqlWalker).
|
||||
', ' . $this->secondPart->dispatch($sqlWalker) .")";
|
||||
}
|
||||
|
||||
@@ -42,13 +37,13 @@ class Similarity extends FunctionNode
|
||||
{
|
||||
$parser->match(Lexer::T_IDENTIFIER);
|
||||
$parser->match(Lexer::T_OPEN_PARENTHESIS);
|
||||
|
||||
|
||||
$this->firstPart = $parser->StringPrimary();
|
||||
|
||||
|
||||
$parser->match(Lexer::T_COMMA);
|
||||
|
||||
|
||||
$this->secondPart = $parser->StringPrimary();
|
||||
|
||||
|
||||
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user