| @@ 10-46 (lines=37) @@ | ||
| 7 | /** |
|
| 8 | * @author Beniamin Jonatan Šimko <[email protected]> |
|
| 9 | */ |
|
| 10 | class Between implements ExpressionInterface |
|
| 11 | { |
|
| 12 | /** |
|
| 13 | * @var ExpressionInterface $wrappedExpression |
|
| 14 | */ |
|
| 15 | private $wrappedExpression; |
|
| 16 | ||
| 17 | /** |
|
| 18 | * @var ExpressionInterface $wrappedExpression |
|
| 19 | */ |
|
| 20 | private $from; |
|
| 21 | ||
| 22 | /** |
|
| 23 | * @var ExpressionInterface $wrappedExpression |
|
| 24 | */ |
|
| 25 | private $to; |
|
| 26 | ||
| 27 | /** |
|
| 28 | * @param ExpressionInterface $expression |
|
| 29 | * @param ExpressionInterface $from |
|
| 30 | * @param ExpressionInterface $to |
|
| 31 | */ |
|
| 32 | public function __construct(ExpressionInterface $expression, ExpressionInterface $from, ExpressionInterface $to) |
|
| 33 | { |
|
| 34 | $this->wrappedExpression = $expression; |
|
| 35 | $this->from = $from; |
|
| 36 | $this->to = $to; |
|
| 37 | } |
|
| 38 | ||
| 39 | /** |
|
| 40 | * @inheritdoc |
|
| 41 | */ |
|
| 42 | public function compile() |
|
| 43 | { |
|
| 44 | return $this->wrappedExpression->compile() . ' BETWEEN ' . $this->from->compile() . ' AND ' . $this->to->compile(); |
|
| 45 | } |
|
| 46 | } |
|
| @@ 10-46 (lines=37) @@ | ||
| 7 | /** |
|
| 8 | * @author Beniamin Jonatan Šimko <[email protected]> |
|
| 9 | */ |
|
| 10 | class NotBetween implements ExpressionInterface |
|
| 11 | { |
|
| 12 | /** |
|
| 13 | * @var ExpressionInterface $wrappedExpression |
|
| 14 | */ |
|
| 15 | private $wrappedExpression; |
|
| 16 | ||
| 17 | /** |
|
| 18 | * @var ExpressionInterface $wrappedExpression |
|
| 19 | */ |
|
| 20 | private $from; |
|
| 21 | ||
| 22 | /** |
|
| 23 | * @var ExpressionInterface $wrappedExpression |
|
| 24 | */ |
|
| 25 | private $to; |
|
| 26 | ||
| 27 | /** |
|
| 28 | * @param ExpressionInterface $expression |
|
| 29 | * @param ExpressionInterface $from |
|
| 30 | * @param ExpressionInterface $to |
|
| 31 | */ |
|
| 32 | public function __construct(ExpressionInterface $expression, ExpressionInterface $from, ExpressionInterface $to) |
|
| 33 | { |
|
| 34 | $this->wrappedExpression = $expression; |
|
| 35 | $this->from = $from; |
|
| 36 | $this->to = $to; |
|
| 37 | } |
|
| 38 | ||
| 39 | /** |
|
| 40 | * @inheritdoc |
|
| 41 | */ |
|
| 42 | public function compile() |
|
| 43 | { |
|
| 44 | return $this->wrappedExpression->compile() . ' NOT BETWEEN ' . $this->from->compile() . ' AND ' . $this->to->compile(); |
|
| 45 | } |
|
| 46 | } |
|