예제 #1
0
 public function fetchAll($where = null, $orderby = null)
 {
     $resultSet = $this->getDbTable()->fetchAll($where, $orderby);
     $entries = array();
     $entry = new Default_Model_Vacancy();
     foreach ($resultSet as $row) {
         $entry->setVacancyId($row['vacancy_id']);
         $entry->setCompanyName($row['company_name']);
         $entry->setJobTitle($row['job_title']);
         $entry->setMinSalary($row['min_salary']);
         $entry->setMaxSalary($row['max_salary']);
         //$entry->setPriority($row['priority']);
         $entry->setWorkLevel($row['work_level']);
         $entry->setLocation($row['location']);
         $entry->setFunction($row['fuction']);
         $entry->setDescReqs($row['desc_reqs']);
         $entry->setCreatedDate($row['created_date']);
         $entry->setUpdatedDate($row['updated_date']);
         $entry->setCreatedConsultantId($row['created_consultant_id']);
         $entry->setUpdatedConsultantId($row['updated_consultant_id']);
         $entries[] = $entry;
     }
     return $entries;
 }
 public function saveVacancyAction()
 {
     $aNamespace = new Zend_Session_Namespace('zs_User');
     $post = $this->getRequest()->getPost();
     $vacancy = new Default_Model_Vacancy();
     $vacancy->setVacancyId($post['vacancy_id']);
     $vacancy->setCompanyName($post['company_name']);
     $vacancy->setJobTitle($post['job_title']);
     $vacancy->setMinSalary(intval($post['min_salary']));
     $vacancy->setMaxSalary(intval($post['max_salary']));
     $vacancy->setWorkLevel($post['work_level']);
     $vacancy->setFunction($post['function']);
     $vacancy->setLocation($post['location']);
     $vacancy->setDescReqs($post['desc_reqs']);
     $vacancy->setCreatedDate(date('Y-m-d'));
     $vacancy->setUpdatedDate(date('Y-m-d'));
     $vacancy->setCreatedConsultantId($aNamespace->consultant_id);
     $vacancy->setUpdatedConsultantId($aNamespace->consultant_id);
     $vacancyMapper = new Default_Model_VacancyMapper();
     $vacancyMapper->save($vacancy);
     $this->_redirect('/vacancy');
 }