2021-04-10 01:33:40 +02:00
|
|
|
<?php
|
|
|
|
|
2022-11-18 18:06:46 +01:00
|
|
|
namespace Core\Driver\SQL\Expression;
|
2021-04-10 01:33:40 +02:00
|
|
|
|
2022-11-18 18:06:46 +01:00
|
|
|
use Core\Driver\SQL\Condition\Condition;
|
2021-04-10 01:33:40 +02:00
|
|
|
|
|
|
|
class CaseWhen extends Expression {
|
|
|
|
|
|
|
|
private Condition $condition;
|
|
|
|
private $trueCase;
|
|
|
|
private $falseCase;
|
|
|
|
|
|
|
|
public function __construct(Condition $condition, $trueCase, $falseCase) {
|
|
|
|
$this->condition = $condition;
|
|
|
|
$this->trueCase = $trueCase;
|
|
|
|
$this->falseCase = $falseCase;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCondition(): Condition { return $this->condition; }
|
|
|
|
public function getTrueCase() { return $this->trueCase; }
|
|
|
|
public function getFalseCase() { return $this->falseCase; }
|
|
|
|
|
|
|
|
}
|