1 | <?php |
||
36 | class BetweenColumnsCondition implements ConditionInterface |
||
37 | { |
||
38 | /** |
||
39 | * @var string $operator the operator to use (e.g. `BETWEEN` or `NOT BETWEEN`) |
||
40 | */ |
||
41 | private $operator; |
||
42 | /** |
||
43 | * @var mixed the value to compare against |
||
44 | */ |
||
45 | private $value; |
||
46 | /** |
||
47 | * @var string|ExpressionInterface|Query the column name or expression that is a beginning of the interval |
||
48 | */ |
||
49 | private $intervalStartColumn; |
||
50 | /** |
||
51 | * @var string|ExpressionInterface|Query the column name or expression that is an end of the interval |
||
52 | */ |
||
53 | private $intervalEndColumn; |
||
54 | |||
55 | /** |
||
56 | * Creates a condition with the `BETWEEN` operator. |
||
57 | * |
||
58 | * @param mixed the value to compare against |
||
59 | * @param string $operator the operator to use (e.g. `BETWEEN` or `NOT BETWEEN`) |
||
60 | * @param string|ExpressionInterface $intervalStartColumn the column name or expression that is a beginning of the interval |
||
61 | * @param string|ExpressionInterface $intervalEndColumn the column name or expression that is an end of the interval |
||
62 | */ |
||
63 | public function __construct($value, $operator, $intervalStartColumn, $intervalEndColumn) |
||
70 | |||
71 | /** |
||
72 | * @return string |
||
73 | */ |
||
74 | 15 | public function getOperator() |
|
78 | |||
79 | /** |
||
80 | * @return mixed |
||
81 | */ |
||
82 | 15 | public function getValue() |
|
86 | |||
87 | /** |
||
88 | * @return string|ExpressionInterface|Query |
||
89 | */ |
||
90 | 15 | public function getIntervalStartColumn() |
|
94 | |||
95 | /** |
||
96 | * @return string|ExpressionInterface|Query |
||
97 | */ |
||
98 | 15 | public function getIntervalEndColumn() |
|
102 | |||
103 | /** |
||
104 | * {@inheritdoc} |
||
105 | * @throws InvalidArgumentException if wrong number of operands have been given. |
||
106 | */ |
||
107 | public static function fromArrayDefinition($operator, $operands) |
||
115 | } |
||
116 |