‪TYPO3CMS  ‪main
ExpressionBuilder.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Doctrine\DBAL\Connection as DoctrineConnection;
21 use Doctrine\DBAL\Platforms\MariaDBPlatform as DoctrineMariaDBPlatform;
22 use Doctrine\DBAL\Platforms\MySQLPlatform as DoctrineMySQLPlatform;
23 use Doctrine\DBAL\Platforms\PostgreSQLPlatform as DoctrinePostgreSQLPlatform;
24 use Doctrine\DBAL\Platforms\SQLitePlatform as DoctrineSQLitePlatform;
25 use Doctrine\DBAL\Platforms\TrimMode;
26 use Doctrine\DBAL\Query\Expression\ExpressionBuilder as DoctrineExpressionBuilder;
27 
39 class ‪ExpressionBuilder extends DoctrineExpressionBuilder
40 {
41  public function ‪__construct(protected readonly DoctrineConnection $connection)
42  {
43  // parent::__construct() skipped by intention, otherwise the private property
44  // nature of the parent constructor will prevent access in extended methods.
45  }
46 
50  public function ‪and(
51  ‪CompositeExpression|\Doctrine\DBAL\Query\Expression\‪CompositeExpression|string|null ...$expressions,
53  return ‪CompositeExpression::and(...$expressions);
54  }
55 
59  public function ‪or(‪CompositeExpression|\Doctrine\DBAL\Query\Expression\‪CompositeExpression|string|null ...$expressions): ‪CompositeExpression
60  {
61  return ‪CompositeExpression::or(...$expressions);
62  }
63 
73  public function ‪comparison($leftExpression, string $operator, $rightExpression): string
74  {
75  return $leftExpression . ' ' . $operator . ' ' . $rightExpression;
76  }
77 
84  public function ‪eq(string $fieldName, $value): string
85  {
86  return $this->‪comparison($this->connection->quoteIdentifier($fieldName), static::EQ, $value);
87  }
88 
101  public function ‪neq(string $fieldName, $value): string
102  {
103  return $this->‪comparison($this->connection->quoteIdentifier($fieldName), static::NEQ, $value);
104  }
105 
112  public function ‪lt(string $fieldName, $value): string
113  {
114  return $this->‪comparison($this->connection->quoteIdentifier($fieldName), static::LT, $value);
115  }
116 
123  public function ‪lte(string $fieldName, $value): string
124  {
125  return $this->‪comparison($this->connection->quoteIdentifier($fieldName), static::LTE, $value);
126  }
127 
134  public function ‪gt(string $fieldName, $value): string
135  {
136  return $this->‪comparison($this->connection->quoteIdentifier($fieldName), static::GT, $value);
137  }
138 
145  public function ‪gte(string $fieldName, $value): string
146  {
147  return $this->‪comparison($this->connection->quoteIdentifier($fieldName), static::GTE, $value);
148  }
149 
155  public function ‪isNull(string $fieldName): string
156  {
157  return $this->connection->quoteIdentifier($fieldName) . ' IS NULL';
158  }
159 
165  public function ‪isNotNull(string $fieldName): string
166  {
167  return $this->connection->quoteIdentifier($fieldName) . ' IS NOT NULL';
168  }
169 
176  public function ‪like(string $fieldName, mixed $value, ?string $escapeChar = null): string
177  {
178  $fieldName = $this->connection->quoteIdentifier($fieldName);
179  $platform = $this->connection->getDatabasePlatform();
180  $escapeChar ??= '\\';
181  if ($escapeChar !== null) {
182  $escapeChar = $this->connection->quote($escapeChar);
183  }
184  if ($platform instanceof DoctrinePostgreSQLPlatform) {
185  // Use ILIKE to mimic case-insensitive search like most people are trained from MySQL/MariaDB.
186  return $this->‪comparison($fieldName, 'ILIKE', $value);
187  }
188  // Note: SQLite does not properly work with non-ascii letters as search word for case-insensitive
189  // matching, UPPER() and LOWER() have the same issue, it only works with ascii letters.
190  // See: https://www.sqlite.org/src/doc/trunk/ext/icu/README.txt
191  return $this->‪comparison($fieldName, 'LIKE', $value)
192  . ($escapeChar !== null && $escapeChar !== '' ? sprintf(' ESCAPE %s', $escapeChar) : '');
193  }
194 
201  public function ‪notLike(string $fieldName, mixed $value, ?string $escapeChar = null): string
202  {
203  $fieldName = $this->connection->quoteIdentifier($fieldName);
204  $platform = $this->connection->getDatabasePlatform();
205  $escapeChar ??= '\\';
206  if ($escapeChar !== null) {
207  $escapeChar = $this->connection->quote($escapeChar);
208  }
209  if ($platform instanceof DoctrinePostgreSQLPlatform) {
210  // Use ILIKE to mimic case-insensitive search like most people are trained from MySQL/MariaDB.
211  return $this->‪comparison($fieldName, 'NOT ILIKE', $value);
212  }
213  // Note: SQLite does not properly work with non-ascii letters as search word for case-insensitive
214  // matching, UPPER() and LOWER() have the same issue, it only works with ascii letters.
215  // See: https://www.sqlite.org/src/doc/trunk/ext/icu/README.txt
216  return $this->‪comparison($fieldName, 'NOT LIKE', $value)
217  . ($escapeChar !== null && $escapeChar !== '' ? sprintf(' ESCAPE %s', $escapeChar) : '');
218  }
219 
227  public function ‪in(string $fieldName, $value): string
228  {
229  if ($value === []) {
230  throw new \InvalidArgumentException(
231  'ExpressionBuilder::in() can not be used with an empty array value.',
232  1701857902
233  );
234  }
235  if ($value === '') {
236  throw new \InvalidArgumentException(
237  'ExpressionBuilder::in() can not be used with an empty string value.',
238  1701857903
239  );
240  }
241  return $this->‪comparison(
242  $this->connection->quoteIdentifier($fieldName),
243  'IN',
244  '(' . implode(', ', (array)$value) . ')'
245  );
246  }
247 
255  public function ‪notIn(string $fieldName, $value): string
256  {
257  if ($value === []) {
258  throw new \InvalidArgumentException(
259  'ExpressionBuilder::notIn() can not be used with an empty array value.',
260  1701857904
261  );
262  }
263  if ($value === '') {
264  throw new \InvalidArgumentException(
265  'ExpressionBuilder::notIn() can not be used with an empty string value.',
266  1701857905
267  );
268  }
269  return $this->‪comparison(
270  $this->connection->quoteIdentifier($fieldName),
271  'NOT IN',
272  '(' . implode(', ', (array)$value) . ')'
273  );
274  }
275 
285  public function ‪inSet(string $fieldName, string $value, bool $isColumn = false): string
286  {
287  if ($value === '') {
288  throw new \InvalidArgumentException(
289  'ExpressionBuilder::inSet() can not be used with an empty string value.',
290  1459696089
291  );
292  }
293  if (str_contains($value, ',')) {
294  throw new \InvalidArgumentException(
295  'ExpressionBuilder::inSet() can not be used with values that contain a comma (",").',
296  1459696090
297  );
298  }
299  $platform = $this->connection->getDatabasePlatform();
300  if ($platform instanceof DoctrinePostgreSQLPlatform) {
301  return $this->‪comparison(
302  $isColumn ? $value . '::text' : $this->‪literal($this->‪unquoteLiteral($value)),
303  self::EQ,
304  sprintf(
305  'ANY(string_to_array(%s, %s))',
306  $this->connection->quoteIdentifier($fieldName) . '::text',
307  $this->literal(',')
308  )
309  );
310  }
311  if ($platform instanceof DoctrineSQLitePlatform) {
312  if (str_starts_with($value, ':') || $value === '?') {
313  throw new \InvalidArgumentException(
314  'ExpressionBuilder::inSet() for SQLite can not be used with placeholder arguments.',
315  1476029421
316  );
317  }
318  return sprintf(
319  'instr(%s, %s)',
320  implode(
321  '||',
322  [
323  $this->‪literal(','),
324  $this->connection->quoteIdentifier($fieldName),
325  $this->literal(','),
326  ]
327  ),
328  $isColumn
329  ? implode(
330  '||',
331  [
332  $this->‪literal(','),
333  // do not explicitly quote value as it is expected to be
334  // quoted by the caller
335  'cast(' . $value . ' as text)',
336  $this->‪literal(','),
337  ]
338  )
339  : $this->‪literal(
340  ',' . $this->‪unquoteLiteral($value) . ','
341  )
342  );
343  }
344  if ($platform instanceof DoctrineMariaDBPlatform || $platform instanceof DoctrineMySQLPlatform) {
345  return sprintf(
346  'FIND_IN_SET(%s, %s)',
347  $value,
348  $this->connection->quoteIdentifier($fieldName)
349  );
350  }
351  throw new \RuntimeException(
352  sprintf('FIND_IN_SET support for database platform "%s" not yet implemented.', $platform::class),
353  1459696680
354  );
355  }
356 
366  public function ‪notInSet(string $fieldName, string $value, bool $isColumn = false): string
367  {
368  if ($value === '') {
369  throw new \InvalidArgumentException(
370  'ExpressionBuilder::notInSet() can not be used with an empty string value.',
371  1627573099
372  );
373  }
374  if (str_contains($value, ',')) {
375  throw new \InvalidArgumentException(
376  'ExpressionBuilder::notInSet() can not be used with values that contain a comma (",").',
377  1627573100
378  );
379  }
380  $platform = $this->connection->getDatabasePlatform();
381  if ($platform instanceof DoctrinePostgreSQLPlatform) {
382  return $this->‪comparison(
383  $isColumn ? $value . '::text' : $this->‪literal($this->‪unquoteLiteral($value)),
384  self::NEQ,
385  sprintf(
386  'ALL(string_to_array(%s, %s))',
387  $this->connection->quoteIdentifier($fieldName) . '::text',
388  $this->literal(',')
389  )
390  );
391  }
392  if ($platform instanceof DoctrineSQLitePlatform) {
393  if (str_starts_with($value, ':') || $value === '?') {
394  throw new \InvalidArgumentException(
395  'ExpressionBuilder::inSet() for SQLite can not be used with placeholder arguments.',
396  1627573103
397  );
398  }
399  return sprintf(
400  'instr(%s, %s) = 0',
401  implode(
402  '||',
403  [
404  $this->‪literal(','),
405  $this->connection->quoteIdentifier($fieldName),
406  $this->literal(','),
407  ]
408  ),
409  $isColumn
410  ? implode(
411  '||',
412  [
413  $this->‪literal(','),
414  // do not explicitly quote value as it is expected to be
415  // quoted by the caller
416  'cast(' . $value . ' as text)',
417  $this->‪literal(','),
418  ]
419  )
420  : $this->‪literal(
421  ',' . $this->‪unquoteLiteral($value) . ','
422  )
423  );
424  }
425  if ($platform instanceof DoctrineMariaDBPlatform || $platform instanceof DoctrineMySQLPlatform) {
426  return sprintf(
427  'NOT FIND_IN_SET(%s, %s)',
428  $value,
429  $this->connection->quoteIdentifier($fieldName)
430  );
431  }
432  throw new \RuntimeException(
433  sprintf('negative FIND_IN_SET support for database platform "%s" not yet implemented.', $platform::class),
434  1627573101
435  );
436  }
437 
444  public function ‪bitAnd(string $fieldName, int $value): string
445  {
446  return $this->‪comparison(
447  $this->connection->quoteIdentifier($fieldName),
448  '&',
449  $value
450  );
451  }
452 
458  public function ‪min(string $fieldName, string $alias = null): string
459  {
460  return $this->‪calculation('MIN', $fieldName, $alias);
461  }
462 
468  public function ‪max(string $fieldName, string $alias = null): string
469  {
470  return $this->‪calculation('MAX', $fieldName, $alias);
471  }
472 
478  public function ‪avg(string $fieldName, string $alias = null): string
479  {
480  return $this->‪calculation('AVG', $fieldName, $alias);
481  }
482 
488  public function ‪sum(string $fieldName, string $alias = null): string
489  {
490  return $this->‪calculation('SUM', $fieldName, $alias);
491  }
492 
498  public function ‪count(string $fieldName, string $alias = null): string
499  {
500  return $this->‪calculation('COUNT', $fieldName, $alias);
501  }
502 
508  public function ‪length(string $fieldName, string $alias = null): string
509  {
510  return $this->‪calculation('LENGTH', $fieldName, $alias);
511  }
512 
533  public function ‪as(string $expression, string $asIdentifier = ''): string
534  {
535  if (‪trim($this->‪trimIdentifierQuotes(‪trim($expression))) === '') {
536  throw new \InvalidArgumentException(
537  sprintf('Value or expression must be provided as first argument for "%s"', __METHOD__),
538  1709826333
539  );
540  }
541  $asIdentifier = ‪trim($this->‪trimIdentifierQuotes(‪trim($this->‪unquoteLiteral($asIdentifier))));
542  if ($asIdentifier !== '') {
543  $asIdentifier = ' AS ' . $this->connection->quoteIdentifier($asIdentifier);
544  }
545  return $expression . $asIdentifier;
546  }
547 
570  public function ‪concat(string ...$parts): string
571  {
572  return $this->connection->getDatabasePlatform()->getConcatExpression(...$parts);
573  }
574 
598  public function ‪castVarchar(string $value, int $length = 255, string $asIdentifier = ''): string
599  {
600  $platform = $this->connection->getDatabasePlatform();
601  $pattern = match (true) {
602  $platform instanceof DoctrinePostgreSQLPlatform => '(%s::%s(%s))',
603  default => '(CAST(%s AS %s(%s)))'
604  };
605  $type = match (true) {
606  // MariaDB added VARCHAR as alias for CHAR to the CAST function, therefore we
607  // need to use CHAR here - albeit this still creates a VARCHAR type as long as
608  // length is not ZERO.
609  // https://dev.mysql.com/doc/refman/8.0/en/cast-functions.html#function_cast
610  $platform instanceof DoctrineMySQLPlatform => 'CHAR',
611  default => 'VARCHAR'
612  };
613  return $this->‪as(sprintf($pattern, $value, $type, $length), $asIdentifier);
614  }
615 
642  public function ‪castInt(string $value, string $asIdentifier = ''): string
643  {
644  // @todo Consider to add a flag to allow unsigned integer casting, except for PostgresSQL
645  // which does not support unsigned integer type at all.
646  $type = 'SIGNED INTEGER';
647  $pattern = '(CAST(%s AS %s))';
648  $platform = $this->connection->getDatabasePlatform();
649  if ($platform instanceof DoctrinePostgreSQLPlatform) {
650  $pattern = '%s::%s';
651  $type = 'INTEGER';
652  }
653  return $this->‪as(sprintf($pattern, $value, $type), $asIdentifier);
654  }
655 
661  protected function ‪calculation(string $aggregateName, string $fieldName, string $alias = null): string
662  {
663  $aggregateSQL = sprintf(
664  '%s(%s)',
665  $aggregateName,
666  $this->connection->quoteIdentifier($fieldName)
667  );
668 
669  if (!empty($alias)) {
670  $aggregateSQL .= ' AS ' . $this->connection->quoteIdentifier($alias);
671  }
672 
673  return $aggregateSQL;
674  }
675 
683  public function ‪trim(string $fieldName, TrimMode $position = TrimMode::UNSPECIFIED, ?string $char = null): string
684  {
685  return $this->connection->getDatabasePlatform()->getTrimExpression(
686  $this->connection->quoteIdentifier($fieldName),
687  $position,
688  ($char === null ? null : $this->literal($char))
689  );
690  }
691 
717  public function ‪repeat(int|string $numberOfRepeats, string $value, string $asIdentifier = ''): string
718  {
719  $numberOfRepeats = $this->‪castInt((string)$numberOfRepeats);
720  $platform = $this->connection->getDatabasePlatform();
721  if ($platform instanceof DoctrineSQLitePlatform) {
722  $pattern = "replace(printf('%%.' || %s || 'c', '/'),'/', %s)";
723  return $this->‪as(
724  sprintf($pattern, $numberOfRepeats, $value),
725  $asIdentifier
726  );
727  }
728  $pattern = 'REPEAT(%s, %s)';
729  return $this->‪as(
730  sprintf($pattern, $value, $numberOfRepeats),
731  $asIdentifier,
732  );
733  }
734 
758  public function ‪space(int|string $numberOfSpaces, string $asIdentifier = ''): string
759  {
760  $platform = $this->connection->getDatabasePlatform();
761  if ($platform instanceof DoctrineMariaDBPlatform || $platform instanceof DoctrineMySQLPlatform) {
762  // Use `SPACE()` method supported by MySQL and MariaDB
763  $pattern = 'SPACE(%s)';
764  $numberOfSpaces = $this->‪castInt((string)$numberOfSpaces);
765  return $this->‪as(
766  sprintf($pattern, $numberOfSpaces),
767  $asIdentifier,
768  );
769  }
770  // Emulate `SPACE()` by using the `repeat()` expression.
771  return $this->‪repeat($numberOfSpaces, $this->connection->quote(' '), $asIdentifier);
772  }
773 
799  public function ‪left(int|string $length, string $value, string $asIdentifier = ''): string
800  {
801  $length = (is_string($length)) ? $this->‪castInt($length) : (string)$length;
802  $platform = $this->connection->getDatabasePlatform();
803  if ($platform instanceof DoctrineSQLitePlatform) {
804  // SQLite does not support `LEFT()`, use `SUBSTRING()` instead. Weirdly, we need to increment the length by
805  // one to get the correct substring length.
806  return $this->‪as(
807  $platform->getSubstringExpression($value, '0', $length . ' + 1'),
808  $asIdentifier,
809  );
810  }
811  return $this->‪as(
812  sprintf('LEFT(%s, %s)', $value, $length),
813  $asIdentifier,
814  );
815  }
816 
842  public function ‪right(int|string $length, string $value, string $asIdentifier = ''): string
843  {
844  if ($asIdentifier !== '') {
845  $asIdentifier = ' AS ' . $this->connection->quoteIdentifier($this->‪unquoteLiteral($this->‪trimIdentifierQuotes($asIdentifier)));
846  }
847  $length = (is_string($length)) ? $this->‪castInt($length) : (string)$length;
848  $platform = $this->connection->getDatabasePlatform();
849  if ($platform instanceof DoctrineSQLitePlatform) {
850  // SQLite does not support `RIGHT()`, use `SUBSTRING()` instead.
851  return $this->connection->getDatabasePlatform()
852  ->getSubstringExpression($value, $length . ' * -1') . $asIdentifier;
853  }
854  return sprintf('RIGHT(%s, %s)', $value, $length) . $asIdentifier;
855  }
856 
882  public function ‪leftPad(string $value, int|string $length, string $paddingValue, string $asIdentifier = ''): string
883  {
884  if (‪trim($this->‪unquoteLiteral($paddingValue), ' ') === '') {
885  throw new \InvalidArgumentException(
886  sprintf('Empty $paddingValue provided for "%s".', __METHOD__),
887  1709658914
888  );
889  }
890  if (strlen(‪trim($this->‪unquoteLiteral($paddingValue), ' ')) > 1) {
891  throw new \InvalidArgumentException(
892  sprintf('Invalid $paddingValue "%s" provided for "%s". Exactly one char allowed.', $paddingValue, __METHOD__),
893  1709659006
894  );
895  }
896  // PostgresSQL is really picky about types when calling functions, therefore we ensure that the value or
897  // expression result is ensured to be string-typed by casting it to a varchar result for all platforms.
898  $value = $this->‪castVarchar($value);
899  $paddingValue = $this->connection->quote($this->‪unquoteLiteral($paddingValue));
900  $platform = $this->connection->getDatabasePlatform();
901  if ($platform instanceof DoctrineSQLitePlatform) {
902  // SQLite does not support `LPAD()`, therefore we need to build up a generic nested method construct to
903  // mimic that method for now. Basically, the length is checked and either the substring up to the length
904  // returned OR the substring from the right side up to the length on the concentrated repeated-value with
905  // the value to cut of the overlapped prefixed repeated value.
906  $repeat = $this->‪repeat(
907  $length,
908  $paddingValue
909  );
910  $pattern = 'IIF(LENGTH(%s) >= %s, %s, %s)';
911  return $this->‪as(sprintf(
912  $pattern,
913  // Value and length for the length check to consider which part to use.
914  $value,
915  $this->‪castInt((string)$length),
916  // Return substring with $length from left side to mimic `LPAD()` behaviour of other platforms.
917  $platform->getSubstringExpression($value, '0', $this->castInt((string)$length) . ' + 1'),
918  // Concatenate `repeat + value` and fetch the substring with length from the right side,
919  // so we cut of overlapping prefixed repeat placeholders.
920  $this->right($length, $this->concat($repeat, $value))
921  ), $asIdentifier);
922  }
923  return $this->‪as(sprintf('LPAD(%s, %s, %s)', $value, $this->‪castInt((string)$length), $paddingValue), $asIdentifier);
924  }
925 
951  public function ‪rightPad(string $value, int|string $length, string $paddingValue, string $asIdentifier = ''): string
952  {
953  if (‪trim($this->‪unquoteLiteral($paddingValue), ' ') === '') {
954  throw new \InvalidArgumentException(
955  sprintf('Empty $paddingValue provided for "%s".', __METHOD__),
956  1709664589
957  );
958  }
959  if (strlen(‪trim($this->‪unquoteLiteral($paddingValue), ' ')) > 1) {
960  throw new \InvalidArgumentException(
961  sprintf('Invalid $paddingValue "%s" provided for "%s". Exactly one char allowed.', $paddingValue, __METHOD__),
962  1709664598
963  );
964  }
965  // PostgresSQL is really picky about types when calling functions, therefore we ensure that the value or
966  // expression result is ensured to be string-type by casting it to a varchar result for all platforms.
967  $value = $this->‪castVarchar($value);
968  $paddingValue = $this->connection->quote($this->‪unquoteLiteral($paddingValue));
969  $platform = $this->connection->getDatabasePlatform();
970  if ($platform instanceof DoctrineSQLitePlatform) {
971  $repeat = $this->‪repeat(
972  $length,
973  $paddingValue
974  );
975  $pattern = 'IIF(LENGTH(%s) >= %s, %s, %s)';
976  return $this->‪as(sprintf(
977  $pattern,
978  // Value and length for the length check to consider which part to use.
979  $value,
980  $this->‪castInt((string)$length),
981  // Return substring with $length from left side to mimic `RPAD()` behaviour of other platforms.
982  // Note: `RPAD()` cuts the value from the left like LPAD(), which is brain melt. Therefore,
983  // this is adopted here to be concise with this behaviour.
984  $this->‪left($length, $value),
985  // Concatenate `repeat + value` and fetch the substring with length from the right side, so we
986  // cut off overlapping prefixed repeat placeholders.
987  $this->‪left($length, $this->‪castVarchar($this->‪concat($value, $this->‪castVarchar($repeat))))
988  ), $asIdentifier);
989  }
990  return $this->‪as(sprintf('RPAD(%s, %s, %s)', $value, $this->‪castInt((string)$length), $paddingValue), $asIdentifier);
991  }
992 
998  public function ‪literal(string $input): string
999  {
1000  return $this->connection->quote($input);
1001  }
1002 
1009  protected function ‪unquoteLiteral(string $value): string
1010  {
1011  if (str_starts_with($value, "'") && str_ends_with($value, "'")) {
1012  $map = [
1013  "''" => "'",
1014  ];
1015  if ($this->connection->getDatabasePlatform() instanceof DoctrineMySQLPlatform) {
1016  // MySQL needs escaped backslashes for quoted value, which we need to revert in case of unquoting.
1017  $map['\\\\'] = '\\';
1018  }
1019  return str_replace(array_keys($map), array_values($map), substr($value, 1, -1));
1020  }
1021  return $value;
1022  }
1023 
1029  private function ‪trimIdentifierQuotes(string ‪$identifier): string
1030  {
1031  return str_replace(['`', '"', '[', ']'], '', ‪$identifier);
1032  }
1033 }
‪TYPO3\CMS\Core\Database\Query\Expression\CompositeExpression\or
‪static or($part=null,... $parts)
Definition: CompositeExpression.php:96
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\unquoteLiteral
‪string unquoteLiteral(string $value)
Definition: ExpressionBuilder.php:1009
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\notLike
‪notLike(string $fieldName, mixed $value, ?string $escapeChar=null)
Definition: ExpressionBuilder.php:201
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\in
‪in(string $fieldName, $value)
Definition: ExpressionBuilder.php:227
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder
Definition: ExpressionBuilder.php:40
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\left
‪string left(int|string $length, string $value, string $asIdentifier='')
Definition: ExpressionBuilder.php:799
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\avg
‪avg(string $fieldName, string $alias=null)
Definition: ExpressionBuilder.php:478
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\or
‪or(CompositeExpression|\Doctrine\DBAL\Query\Expression\CompositeExpression|string|null ... $expressions)
Definition: ExpressionBuilder.php:59
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\comparison
‪comparison($leftExpression, string $operator, $rightExpression)
Definition: ExpressionBuilder.php:73
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\rightPad
‪string rightPad(string $value, int|string $length, string $paddingValue, string $asIdentifier='')
Definition: ExpressionBuilder.php:951
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\gte
‪gte(string $fieldName, $value)
Definition: ExpressionBuilder.php:145
‪TYPO3\CMS\Core\Database\Query\Expression
Definition: CompositeExpression.php:18
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\eq
‪eq(string $fieldName, $value)
Definition: ExpressionBuilder.php:84
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\trim
‪trim(string $fieldName, TrimMode $position=TrimMode::UNSPECIFIED, ?string $char=null)
Definition: ExpressionBuilder.php:683
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\castInt
‪string castInt(string $value, string $asIdentifier='')
Definition: ExpressionBuilder.php:642
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\isNotNull
‪isNotNull(string $fieldName)
Definition: ExpressionBuilder.php:165
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\min
‪min(string $fieldName, string $alias=null)
Definition: ExpressionBuilder.php:458
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\gt
‪gt(string $fieldName, $value)
Definition: ExpressionBuilder.php:134
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\length
‪length(string $fieldName, string $alias=null)
Definition: ExpressionBuilder.php:508
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\calculation
‪calculation(string $aggregateName, string $fieldName, string $alias=null)
Definition: ExpressionBuilder.php:661
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\lte
‪lte(string $fieldName, $value)
Definition: ExpressionBuilder.php:123
‪TYPO3\CMS\Core\Database\Query\Expression\CompositeExpression\and
‪static and($part=null,... $parts)
Definition: CompositeExpression.php:85
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\count
‪count(string $fieldName, string $alias=null)
Definition: ExpressionBuilder.php:498
‪TYPO3\CMS\Core\Database\Query\Expression\CompositeExpression
Definition: CompositeExpression.php:27
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\trimIdentifierQuotes
‪trimIdentifierQuotes(string $identifier)
Definition: ExpressionBuilder.php:1029
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\isNull
‪isNull(string $fieldName)
Definition: ExpressionBuilder.php:155
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\repeat
‪string repeat(int|string $numberOfRepeats, string $value, string $asIdentifier='')
Definition: ExpressionBuilder.php:717
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\space
‪string space(int|string $numberOfSpaces, string $asIdentifier='')
Definition: ExpressionBuilder.php:758
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\__construct
‪__construct(protected readonly DoctrineConnection $connection)
Definition: ExpressionBuilder.php:41
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\sum
‪sum(string $fieldName, string $alias=null)
Definition: ExpressionBuilder.php:488
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\right
‪string right(int|string $length, string $value, string $asIdentifier='')
Definition: ExpressionBuilder.php:842
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\bitAnd
‪bitAnd(string $fieldName, int $value)
Definition: ExpressionBuilder.php:444
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\notIn
‪notIn(string $fieldName, $value)
Definition: ExpressionBuilder.php:255
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\inSet
‪inSet(string $fieldName, string $value, bool $isColumn=false)
Definition: ExpressionBuilder.php:285
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\as
‪string as(string $expression, string $asIdentifier='')
Definition: ExpressionBuilder.php:533
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\max
‪max(string $fieldName, string $alias=null)
Definition: ExpressionBuilder.php:468
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\and
‪and(CompositeExpression|\Doctrine\DBAL\Query\Expression\CompositeExpression|string|null ... $expressions,)
Definition: ExpressionBuilder.php:50
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\castVarchar
‪string castVarchar(string $value, int $length=255, string $asIdentifier='')
Definition: ExpressionBuilder.php:598
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\like
‪like(string $fieldName, mixed $value, ?string $escapeChar=null)
Definition: ExpressionBuilder.php:176
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\lt
‪lt(string $fieldName, $value)
Definition: ExpressionBuilder.php:112
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\concat
‪string concat(string ... $parts)
Definition: ExpressionBuilder.php:570
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\literal
‪literal(string $input)
Definition: ExpressionBuilder.php:998
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\notInSet
‪notInSet(string $fieldName, string $value, bool $isColumn=false)
Definition: ExpressionBuilder.php:366
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\leftPad
‪string leftPad(string $value, int|string $length, string $paddingValue, string $asIdentifier='')
Definition: ExpressionBuilder.php:882
‪TYPO3\CMS\Webhooks\Message\$identifier
‪identifier readonly string $identifier
Definition: FileAddedMessage.php:37
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\neq
‪neq(string $fieldName, $value)
Definition: ExpressionBuilder.php:101