/**
  * Validates job description
  *
  * @return boolean
  */
 protected function _validateDescription()
 {
     $validator = new Zend_Validate_StringLength(2);
     if ($validator->isValid($this->category->getDescription())) {
         return true;
     }
     $msg = Sanmax_MessageStack::getInstance('SxCms_Job_Profession');
     $msg->addMessage('description', $validator->getMessages());
     return false;
 }
Exemple #2
0
 public function getAll()
 {
     $db = Zend_Registry::get('db');
     $select = $db->select()->from('VacancyProf', array('*'))->where('language = ?', $_SESSION['System']['lng']);
     $stmt = $db->query($select);
     $result = $stmt->fetchAll();
     $professions = array();
     foreach ($result as $pub) {
         $profession = new SxCms_Job_Profession();
         $profession->setId($pub['vacancy_prof_id'])->setLanguage($pub['language'])->setName($pub['name'])->setDescription($pub['description']);
         $professions[$profession->getId()] = $profession;
     }
     return $professions;
 }