Example #1
0
 /**
  * Add when expression
  *
  * @param string|ExpressionInterface $expression
  * @param string|ExpressionInterface $thenExpression
  *
  * @return $this
  */
 public function when($expression, $thenExpression)
 {
     $this->whenThenExpressions[] = ['WHEN' => $expression, 'THEN' => $thenExpression];
     if ($expression instanceof ExpressionInterface) {
         $this->pushParams($expression->getParams());
     }
     if ($thenExpression instanceof ExpressionInterface) {
         $this->pushParams($thenExpression->getParams());
     }
     return $this;
 }