Esempio n. 1
0
 /**
  * Map to database column.
  * @param string $column
  * @param string $operator
  * @return Filter
  */
 public function setColumn($column, $operator = Condition::OPERATOR_OR)
 {
     $columnAlreadySet = count($this->column) > 0;
     if (!Condition::isOperator($operator) && $columnAlreadySet) {
         throw new \InvalidArgumentException('Operator must be Condition::OPERATOR_AND or Condition::OPERATOR_OR.');
     }
     if ($columnAlreadySet) {
         $this->column[] = $operator;
         $this->column[] = $column;
     } else {
         $this->column[] = $column;
     }
     return $this;
 }