Skip to content

Commit

Permalink
Merge pull request #10 from GeraudBourdin/main
Browse files Browse the repository at this point in the history
ORM 3 compatibility
  • Loading branch information
GeraudBourdin authored Aug 15, 2024
2 parents 789c507 + 64e3dbd commit 9f67484
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/Query/Distance.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Partitech\DoctrinePgVector\Query;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\TokenType;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\QueryException;
use Doctrine\ORM\Query\SqlWalker;
Expand All @@ -20,12 +20,12 @@ class Distance extends FunctionNode
*/
public function parse(Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$parser->match(TokenType::T_IDENTIFIER);
$parser->match(TokenType::T_OPEN_PARENTHESIS);
$this->field = $parser->StringPrimary();
$parser->match(Lexer::T_COMMA);
$parser->match(TokenType::T_COMMA);
$this->vector = $parser->StringExpression();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
}

public function getSql(SqlWalker $sqlWalker): string
Expand Down
10 changes: 5 additions & 5 deletions src/Query/InnerProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
namespace Partitech\DoctrinePgVector\Query;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\QueryException;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\TokenType;

class InnerProduct extends FunctionNode
{
Expand All @@ -20,12 +20,12 @@ class InnerProduct extends FunctionNode
*/
public function parse(Parser $parser): void
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$parser->match(TokenType::T_IDENTIFIER);
$parser->match(TokenType::T_OPEN_PARENTHESIS);
$this->field = $parser->StringPrimary();
$parser->match(Lexer::T_COMMA);
$parser->match(TokenType::T_COMMA);
$this->vector = $parser->StringExpression();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
}

public function getSql(SqlWalker $sqlWalker): string
Expand Down

0 comments on commit 9f67484

Please sign in to comment.