Esempio n. 1
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = AlumniWorkHistoryPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setStudentId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setEmployeeType($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setCompanyName($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setCompanyAddress($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setCompanyPhone($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setCompanyFax($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setJobType($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setWaitingTime($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setSalary($arr[$keys[9]]);
     }
 }
Esempio n. 2
0
 public function executeDelete()
 {
     $student_id = $this->getRequestParameter('student_id');
     $student = StudentPeer::retrieveByPK($student_id);
     $this->forward404Unless($student);
     $this->student = $student;
     $alumni_work_history = AlumniWorkHistoryPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($alumni_work_history);
     $ref_error = 0;
     foreach ($alumni_work_history->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $alumni_work_history->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('alumni_work_history/delete/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('alumni_work_history/delete', '_ERR_DELETE_ (' . $alumni_work_history->toString() . ' - id:' . $alumni_work_history->getId() . ')');
     } else {
         $alumni_work_history->delete();
     }
     $this->getRequest()->setParameter('student_id', $student_id);
     return $this->forward('alumni_work_history', 'list?student_id=' . $student_id);
 }
 public static function retrieveByPKs($pks, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria();
         $criteria->add(AlumniWorkHistoryPeer::ID, $pks, Criteria::IN);
         $objs = AlumniWorkHistoryPeer::doSelect($criteria, $con);
     }
     return $objs;
 }