summaryrefslogtreecommitdiff
path: root/vendor/doctrine/orm/src/Query/AST/OrderByItem.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2024-08-13 23:45:21 +0200
committerpolo <ordipolo@gmx.fr>2024-08-13 23:45:21 +0200
commitbf6655a534a6775d30cafa67bd801276bda1d98d (patch)
treec6381e3f6c81c33eab72508f410b165ba05f7e9c /vendor/doctrine/orm/src/Query/AST/OrderByItem.php
parent94d67a4b51f8e62e7d518cce26a526ae1ec48278 (diff)
downloadAppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.zip
VERSION 0.2 doctrine ORM et entités
Diffstat (limited to 'vendor/doctrine/orm/src/Query/AST/OrderByItem.php')
-rw-r--r--vendor/doctrine/orm/src/Query/AST/OrderByItem.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Query/AST/OrderByItem.php b/vendor/doctrine/orm/src/Query/AST/OrderByItem.php
new file mode 100644
index 0000000..64b3f40
--- /dev/null
+++ b/vendor/doctrine/orm/src/Query/AST/OrderByItem.php
@@ -0,0 +1,38 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Query\AST;
6
7use Doctrine\ORM\Query\SqlWalker;
8
9use function strtoupper;
10
11/**
12 * OrderByItem ::= (ResultVariable | StateFieldPathExpression) ["ASC" | "DESC"]
13 *
14 * @link www.doctrine-project.org
15 */
16class OrderByItem extends Node
17{
18 public string $type;
19
20 public function __construct(public mixed $expression)
21 {
22 }
23
24 public function isAsc(): bool
25 {
26 return strtoupper($this->type) === 'ASC';
27 }
28
29 public function isDesc(): bool
30 {
31 return strtoupper($this->type) === 'DESC';
32 }
33
34 public function dispatch(SqlWalker $walker): string
35 {
36 return $walker->walkOrderByItem($this);
37 }
38}