public function save(Default_Model_Vacancy $vacancy) { $data = array('vacancy_id' => $vacancy->getVacancyId(), 'company_name' => $vacancy->getCompanyName(), 'job_title' => $vacancy->getJobTitle(), 'min_salary' => $vacancy->getMinSalary(), 'max_salary' => $vacancy->getMaxSalary(), 'work_level' => $vacancy->getWorkLevel(), 'function' => $vacancy->getFunction(), 'location' => $vacancy->getLocation(), 'desc_reqs' => $vacancy->getDescReqs(), 'created_date' => $vacancy->getCreatedDate(), 'updated_date' => $vacancy->getUpdatedDate(), 'created_consultant_id' => $vacancy->getCreatedConsultantId(), 'updated_consultant_id' => $vacancy->getUpdatedConsultantId()); if (null == ($id = $vacancy->getVacancyId())) { return $this->getDbTable()->insert($data); } else { unset($data['created_date']); unset($data['created_consultant_id']); $this->getDbTable()->update($data, array('vacancy_id = ?' => $id)); return $id; } }