Exemplo n.º 1
0
 public function toObject(array $import)
 {
     $fields = array('vacancy_cat_id' => null, 'parent_id' => null, 'language' => null, 'name' => null, 'description' => null);
     foreach ($import as $key => $value) {
         if (array_key_exists($key, $fields)) {
             $fields[$key] = $value;
         }
     }
     $category = new SxCms_Job_Category();
     $category->setId($fields['vacancy_cat_id'])->setParentId($fields['parent_id'])->setLanguage($fields['language'])->setName($fields['name'])->setDescription($fields['description']);
     return $category;
 }
Exemplo n.º 2
0
 public function getModelFromArray(array $data)
 {
     $fields = array('author_id' => null, 'vacancy_id' => null, 'title' => null, 'description' => null, 'phone' => null, 'mobile' => null, 'email' => null, 'term' => null, 'region' => null, 'category_id' => null, 'hours' => null, 'seeker_name' => null, 'seeker_fname' => null, 'date_expired' => null, 'date_published' => null);
     foreach ($data as $key => $value) {
         if (array_key_exists($key, $fields)) {
             $fields[$key] = $value;
         }
     }
     $vacancy = new SxCms_Job();
     $vacancy->setId($fields['vacancy_id'])->setJobtitle($fields['title'])->setDescription($fields['description'])->setPhone($fields['phone'])->setMobile($fields['mobile'])->setEmail($fields['email'])->setTerm($fields['term'])->setSeekerFirstName($fields['seeker_name'])->setSeekerName($fields['seeker_fname']);
     $address = new SxCms_Address();
     $address->setRegion($fields['region']);
     $category = new SxCms_Job_Category();
     $category->setId($fields['category_id']);
     $vacancy->setCategory($category);
     $vacancy->setAddress($address)->setHours($fields['hours'])->setExpireDate($fields['date_expired'])->setPublicationDate($fields['date_published']);
     return $vacancy;
 }
Exemplo n.º 3
0
 public function loadState()
 {
     $db = Zend_Registry::get('db');
     $select = $db->select()->from('Vacancy', array('*'))->where('vacancy_id = ?', $this->id);
     $stmt = $db->query($select);
     $result = $stmt->fetchAll();
     foreach ($result as $job) {
         $this->setId($job['vacancy_id'])->setJobTitle($job['title'])->setPhone($job['phone'])->setMobile($job['mobile'])->setEmail($job['email'])->setTerm($job['term'])->setDescription($job['description'])->setExpireDate($job['date_expired'])->setPublicationDate($job['date_published'])->setSeekerFirstName($job['seeker_name'])->setSeekerName($job['seeker_fname']);
         $category = new SxCms_Job_Category();
         $category->setId($job['category_id']);
         $this->setCategory($category);
         $address = new SxCms_Address();
         $address->setRegion($job['region']);
         $this->setAddress($address)->setHours($job['hours'])->setNotes($job['notes']);
     }
     return $this;
 }