/** * Constructor * * @param array $array */ public function __construct($array) { if (!$array) { throw new \Exception('FilterFieldDescription::name IS NULL'); } $this->name = $array[0]; $this->type = isset($array[1]) ? $array[1] : 'text_filter'; $this->label = isset($array[2]) ? $array[2] : $array[0]; $this->count = isset($array[3]) ? $array[3] : 1; if (isset($array[4])) { if (!ConditionOperator::validate($array[4])) { throw new \Exception(sprintf("ConditionOperator %s does not exist", $array[1])); } $this->condition_operator = $array[4]; } else { $this->condition_operator = 'full_text'; } $this->options = isset($array[5]) ? $array[5] : array(); }