vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Comparison.php line 12

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Doctrine\ORM\Query\Expr;
  4. /**
  5.  * Expression class for DQL comparison expressions.
  6.  *
  7.  * @link    www.doctrine-project.org
  8.  */
  9. class Comparison
  10. {
  11.     public const EQ  '=';
  12.     public const NEQ '<>';
  13.     public const LT  '<';
  14.     public const LTE '<=';
  15.     public const GT  '>';
  16.     public const GTE '>=';
  17.     /** @var mixed */
  18.     protected $leftExpr;
  19.     /** @var string */
  20.     protected $operator;
  21.     /** @var mixed */
  22.     protected $rightExpr;
  23.     /**
  24.      * Creates a comparison expression with the given arguments.
  25.      *
  26.      * @param mixed  $leftExpr
  27.      * @param string $operator
  28.      * @param mixed  $rightExpr
  29.      */
  30.     public function __construct($leftExpr$operator$rightExpr)
  31.     {
  32.         $this->leftExpr  $leftExpr;
  33.         $this->operator  $operator;
  34.         $this->rightExpr $rightExpr;
  35.     }
  36.     /**
  37.      * @return mixed
  38.      */
  39.     public function getLeftExpr()
  40.     {
  41.         return $this->leftExpr;
  42.     }
  43.     /**
  44.      * @return string
  45.      */
  46.     public function getOperator()
  47.     {
  48.         return $this->operator;
  49.     }
  50.     /**
  51.      * @return mixed
  52.      */
  53.     public function getRightExpr()
  54.     {
  55.         return $this->rightExpr;
  56.     }
  57.     /**
  58.      * @return string
  59.      */
  60.     public function __toString()
  61.     {
  62.         return $this->leftExpr ' ' $this->operator ' ' $this->rightExpr;
  63.     }
  64. }