Пример #1
0
 public function executeDelete()
 {
     $this->ng_test_applicant = NgTestApplicantPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($this->ng_test_applicant);
     $c = new Criteria();
     $c->add(NgTestApplSchedPeer::NG_TEST_APPLICANT_ID, $this->ng_test_applicant->getId());
     $tas = NgTestApplSchedPeer::doSelectOne($c);
     if ($tas) {
         $ct = new Criteria();
         $ct->add(NgTestApplScorePeer::NG_TEST_APPL_SCHED_ID, $tas->getId());
         $tasc = NgTestApplScorePeer::doSelect($ct);
         if ($tasc) {
             foreach ($tasc as $ta) {
                 $ta->delete();
             }
         }
         $tas->delete();
     }
     $cw = new Criteria();
     $cw->add(NgTestApplicantParentsPeer::NG_TEST_APPLICANT_ID, $this->ng_test_applicant->getId());
     $taps = NgTestApplicantParentsPeer::doSelect($cw);
     if ($taps) {
         foreach ($taps as $tps) {
             $tps->delete();
         }
     }
     $this->ng_test_applicant->delete();
     $this->getRequest()->setError('ng_test_applicant/delete', '_DATA_DONE_DELETE_ ');
     return $this->forward('ng_test_applicant', 'list');
 }
Пример #2
0
 public function getNgTestApplicantParentssJoinSalary($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseNgTestApplicantParentsPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collNgTestApplicantParentss === null) {
         if ($this->isNew()) {
             $this->collNgTestApplicantParentss = array();
         } else {
             $criteria->add(NgTestApplicantParentsPeer::JOB_TYPE_ID, $this->getId());
             $this->collNgTestApplicantParentss = NgTestApplicantParentsPeer::doSelectJoinSalary($criteria, $con);
         }
     } else {
         $criteria->add(NgTestApplicantParentsPeer::JOB_TYPE_ID, $this->getId());
         if (!isset($this->lastNgTestApplicantParentsCriteria) || !$this->lastNgTestApplicantParentsCriteria->equals($criteria)) {
             $this->collNgTestApplicantParentss = NgTestApplicantParentsPeer::doSelectJoinSalary($criteria, $con);
         }
     }
     $this->lastNgTestApplicantParentsCriteria = $criteria;
     return $this->collNgTestApplicantParentss;
 }
Пример #3
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = NgTestApplicantParentsPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setNgTestApplicantId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setReligionId($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setDegreeId($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setSalaryId($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setJobTypeId($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setRelation($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setName($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setPob($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setDob($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setJobDetail($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setCellphone($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setHomephone($arr[$keys[12]]);
     }
     if (array_key_exists($keys[13], $arr)) {
         $this->setEmail($arr[$keys[13]]);
     }
     if (array_key_exists($keys[14], $arr)) {
         $this->setCountryId($arr[$keys[14]]);
     }
     if (array_key_exists($keys[15], $arr)) {
         $this->setRegionId($arr[$keys[15]]);
     }
     if (array_key_exists($keys[16], $arr)) {
         $this->setCityId($arr[$keys[16]]);
     }
     if (array_key_exists($keys[17], $arr)) {
         $this->setDistrictId($arr[$keys[17]]);
     }
     if (array_key_exists($keys[18], $arr)) {
         $this->setSubdistrictId($arr[$keys[18]]);
     }
     if (array_key_exists($keys[19], $arr)) {
         $this->setPostcode($arr[$keys[19]]);
     }
     if (array_key_exists($keys[20], $arr)) {
         $this->setOfficeName($arr[$keys[20]]);
     }
     if (array_key_exists($keys[21], $arr)) {
         $this->setOfficeAddress($arr[$keys[21]]);
     }
     if (array_key_exists($keys[22], $arr)) {
         $this->setOfficePhone($arr[$keys[22]]);
     }
     if (array_key_exists($keys[23], $arr)) {
         $this->setAddress($arr[$keys[23]]);
     }
     if (array_key_exists($keys[24], $arr)) {
         $this->setHomeNo($arr[$keys[24]]);
     }
     if (array_key_exists($keys[25], $arr)) {
         $this->setHomeRt($arr[$keys[25]]);
     }
     if (array_key_exists($keys[26], $arr)) {
         $this->setHomeRw($arr[$keys[26]]);
     }
     if (array_key_exists($keys[27], $arr)) {
         $this->setCreated($arr[$keys[27]]);
     }
 }
 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(NgTestApplicantParentsPeer::ID, $pks, Criteria::IN);
         $objs = NgTestApplicantParentsPeer::doSelect($criteria, $con);
     }
     return $objs;
 }