model=$model; $this->field_name=$field_name; $this->field_value=$field_value; } public function form() { if($this->field_value=='' || $this->field_name=='') { throw new \Exception('Need field_value and field_name property'); } $this->model->set_conditions($this->conditions[0], $this->conditions[1]); $query=$this->model->select(array($this->field_name, $this->field_value), $this->raw_query); if($this->empty_value) { $this->arr_select['']=''; } while($row=$this->model->fetch_array($query)) { $this->arr_select[$row[$this->field_value]]=$this->model->components[$this->field_name]->show_formatted($row[$this->field_name]); } return parent::form(); } } ?>