diff options
Diffstat (limited to 'vendor/doctrine/orm/src/Query/Expr/Comparison.php')
| -rw-r--r-- | vendor/doctrine/orm/src/Query/Expr/Comparison.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Query/Expr/Comparison.php b/vendor/doctrine/orm/src/Query/Expr/Comparison.php new file mode 100644 index 0000000..ec8ef21 --- /dev/null +++ b/vendor/doctrine/orm/src/Query/Expr/Comparison.php | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Query\Expr; | ||
| 6 | |||
| 7 | use Stringable; | ||
| 8 | |||
| 9 | /** | ||
| 10 | * Expression class for DQL comparison expressions. | ||
| 11 | * | ||
| 12 | * @link www.doctrine-project.org | ||
| 13 | */ | ||
| 14 | class Comparison implements Stringable | ||
| 15 | { | ||
| 16 | final public const EQ = '='; | ||
| 17 | final public const NEQ = '<>'; | ||
| 18 | final public const LT = '<'; | ||
| 19 | final public const LTE = '<='; | ||
| 20 | final public const GT = '>'; | ||
| 21 | final public const GTE = '>='; | ||
| 22 | |||
| 23 | /** Creates a comparison expression with the given arguments. */ | ||
| 24 | public function __construct(protected mixed $leftExpr, protected string $operator, protected mixed $rightExpr) | ||
| 25 | { | ||
| 26 | } | ||
| 27 | |||
| 28 | public function getLeftExpr(): mixed | ||
| 29 | { | ||
| 30 | return $this->leftExpr; | ||
| 31 | } | ||
| 32 | |||
| 33 | public function getOperator(): string | ||
| 34 | { | ||
| 35 | return $this->operator; | ||
| 36 | } | ||
| 37 | |||
| 38 | public function getRightExpr(): mixed | ||
| 39 | { | ||
| 40 | return $this->rightExpr; | ||
| 41 | } | ||
| 42 | |||
| 43 | public function __toString(): string | ||
| 44 | { | ||
| 45 | return $this->leftExpr . ' ' . $this->operator . ' ' . $this->rightExpr; | ||
| 46 | } | ||
| 47 | } | ||
