예제 #1
0
 /**
  * @inheritdoc
  * @param mixed $min The min value
  * @param mixed $max The max value
  * @param int $dataType The PDO data type for the min and max
  */
 public function __construct(string $column, $min, $max, int $dataType = PDO::PARAM_STR)
 {
     parent::__construct($column);
     $this->min = $min;
     $this->max = $max;
     $this->dataType = $dataType;
 }
예제 #2
0
 /**
  * @inheritdoc
  * @param array|string $parametersOrExpression Either the parameters or the sub-expression
  * @throws InvalidArgumentException Thrown if the parameters are not in the correct format
  */
 public function __construct(string $column, $parametersOrExpression)
 {
     parent::__construct($column);
     if (is_string($parametersOrExpression)) {
         $this->usingParameters = false;
         $this->expression = $parametersOrExpression;
     } else {
         if (is_array($parametersOrExpression)) {
             $this->usingParameters = true;
             $this->parameters = $parametersOrExpression;
         } else {
             throw new InvalidArgumentException("Must pass either parameters or sub-expression to IN condition");
         }
     }
 }