Skip to content

Commit 35553fe

Browse files
committed
Fixing ORM helpers and base classes.
1 parent 04991eb commit 35553fe

File tree

5 files changed

+22
-21
lines changed

5 files changed

+22
-21
lines changed

app/model/entity/base/VersionableEntity.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
trait VersionableEntity
88
{
9-
109
/**
1110
* @ORM\Column(type="integer")
1211
*/

app/model/helpers/CustomCoalesceFunction.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace DoctrineExtensions\Query\Functions;
44

55
use Doctrine\ORM\Query\Lexer;
6+
use Doctrine\ORM\Query\TokenType;
67
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
78

89
/**
@@ -38,21 +39,21 @@ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
3839
*/
3940
public function parse(\Doctrine\ORM\Query\Parser $parser)
4041
{
41-
$parser->match(Lexer::T_IDENTIFIER);
42-
$parser->match(Lexer::T_OPEN_PARENTHESIS);
42+
$parser->match(TokenType::T_IDENTIFIER);
43+
$parser->match(TokenType::T_OPEN_PARENTHESIS);
4344

44-
$parser->match(Lexer::T_OPEN_PARENTHESIS);
45+
$parser->match(TokenType::T_OPEN_PARENTHESIS);
4546
$this->subselectExpressions[] = $parser->Subselect();
46-
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
47+
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
4748

48-
while ($parser->getLexer()->isNextToken(Lexer::T_COMMA)) {
49-
$parser->match(Lexer::T_COMMA);
49+
while ($parser->getLexer()->isNextToken(TokenType::T_COMMA)) {
50+
$parser->match(TokenType::T_COMMA);
5051

51-
$parser->match(Lexer::T_OPEN_PARENTHESIS);
52+
$parser->match(TokenType::T_OPEN_PARENTHESIS);
5253
$this->subselectExpressions[] = $parser->Subselect();
53-
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
54+
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
5455
}
5556

56-
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
57+
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
5758
}
5859
}

app/model/helpers/DqlTypeFunction.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
use Doctrine\ORM\Query\Parser;
88
use Doctrine\ORM\Query\QueryException;
99
use Doctrine\ORM\Query\SqlWalker;
10+
use Doctrine\ORM\Query\TokenType;
1011

1112
/**
1213
* Provides a way to access an entity's discriminator field in DQL
1314
* queries.
1415
*
1516
* Assuming the same "Person" entity from Doctrine's documentation on
16-
* Inheritence Mapping, which has a discriminator field named "discr":
17+
* Inheritance Mapping, which has a discriminator field named "discr":
1718
*
1819
* Using the TYPE() function, DQL will interpret this:
1920
*
@@ -66,11 +67,11 @@ public function getSql(SqlWalker $sqlWalker)
6667
*/
6768
public function parse(Parser $parser)
6869
{
69-
$parser->match(Lexer::T_IDENTIFIER);
70-
$parser->match(Lexer::T_OPEN_PARENTHESIS);
70+
$parser->match(TokenType::T_IDENTIFIER);
71+
$parser->match(TokenType::T_OPEN_PARENTHESIS);
7172

7273
$this->dqlAlias = $parser->IdentificationVariable();
7374

74-
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
75+
$parser->match(TokenType::T_CLOSE_PARENTHESIS);
7576
}
7677
}

app/model/helpers/OrderByCollationInjectionMysqlWalker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class OrderByCollationInjectionMysqlWalker extends SqlWalker
1313
/**
1414
* Name of the hint, which holds the actual collation.
1515
*/
16-
const HINT_COLLATION = 'orderByCollationInjectionMysqlWalker.collation';
17-
const HINT_COLLATION_FORBIDDEN_COLUMNS = 'orderByCollationInjectionMysqlWalker.forbiddenCols';
16+
public const HINT_COLLATION = 'orderByCollationInjectionMysqlWalker.collation';
17+
public const HINT_COLLATION_FORBIDDEN_COLUMNS = 'orderByCollationInjectionMysqlWalker.forbiddenCols';
1818

1919
private function isForbidden($orderByItemTokens)
2020
{

app/model/helpers/PaginationDBHelper.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class PaginationDbHelper
4747

4848
/**
4949
* Internal function that appends andWhere clause to query builder handling
50-
* fultext search of one search token.
50+
* full text search of one search token.
5151
*/
5252
private function addSearchCondition(QueryBuilder $qb, string $searchToken, string $alias)
5353
{
@@ -81,10 +81,10 @@ private function addSearchCondition(QueryBuilder $qb, string $searchToken, strin
8181
}
8282

8383
/**
84-
* Createa and initialize the helper.
84+
* Create and initialize the helper.
8585
* @param array $orderByColumns Known order by names (sent from UI), each holding a list
8686
* of corresponding order by DB columns.
87-
* @param array $searchCols List of columns which are tested by fultext search filter.
87+
* @param array $searchCols List of columns which are tested by full text search filter.
8888
* @param string|null $localizedTextsClass Name of an entity class which is used for localization texts.
8989
* If null, no localization is expected.
9090
*/
@@ -116,7 +116,7 @@ public function applySearchFilter(QueryBuilder $qb, string $search, ?string $ali
116116
}
117117

118118
/**
119-
* Apply the helper on a query bulider (add common clauses) using pagination metadata.
119+
* Apply the helper on a query builder (add common clauses) using pagination metadata.
120120
* @param QueryBuilder $qb Query builder being augmented.
121121
* @param Pagination $pagination Pagination object which holds the filter and order by parameters.
122122
* @param string|null $alias Alias of the main table use in the query builder. If null, alias is auto-detected.
@@ -152,7 +152,7 @@ public function apply(QueryBuilder $qb, Pagination $pagination, ?string $alias =
152152
}
153153

154154
/**
155-
* Apply collation patches on the query yileded from the builder and fetch the results.
155+
* Apply collation patches on the query yielded from the builder and fetch the results.
156156
* @param QueryBuilder $qb Query builder holding the final query.
157157
* @param Pagination $pagination Pagination object which holds the filter and order by parameters.
158158
* @return array

0 commit comments

Comments
 (0)