Example #1
0
 /**
  * Sets the main operator (AND or OR)
  * @param string $operator self::OPERATOR_AND or self::OPERATOR_OR
  * @throws \InvalidArgumentException
  */
 public function setMainOperator($operator)
 {
     switch ($operator) {
         case self::OPERATOR_AND:
             $this->mainOperator = self::OPERATOR_AND;
             break;
         case self::OPERATOR_OR:
             $this->mainOperator = self::OPERATOR_OR;
             break;
         default:
             throw new \InvalidArgumentException(__CLASS__ . '::' . __FUNCTION__ . '() First argument should be ' . __CLASS__ . '::OPERATOR_AND or ' . __CLASS__ . '::OPERATOR_OR constant');
             break;
     }
     $this->rootOperation->setOperator($this->mainOperator);
 }