public function allToArray() { $arr = parent::toArray(); $query = new Daq_Db_Query(); $opt = $query->select()->from("Wpjb_Model_FieldOption t")->execute(); $list = array(); foreach ($opt as $o) { $list[$o->value] = $o->id; } $query = new Daq_Db_Query(); $result = $query->select("*")->from("Wpjb_Model_AdditionalField t1")->join("t1.value t2", "t2.job_id=" . $this->getId())->where("is_active=1")->execute(); foreach ($result as $obj) { if ($obj->type == Daq_Form_Element::TYPE_SELECT) { $val = $list[$obj->getValue()->value]; } else { $val = $obj->getValue()->value; } $arr['field_' . $obj->getId()] = $val; } return $arr; }
public function allToArray() { $arr = parent::toArray(); $field = (array) $this->getNonEmptyFields(); $txtar = (array) $this->getNonEmptyTextareas(); foreach ($field as $f) { $arr["field_" . $f->field_id] = $f->value; } foreach ($txtar as $f) { $arr["field_" . $f->field_id] = $f->value; } return $arr; }