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(NgTestApplScorePeer::ID, $pks, Criteria::IN);
         $objs = NgTestApplScorePeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Example #2
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = NgTestApplScorePeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setNgTestApplSchedId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setNgTestSubjectId($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setGrade($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setMarks($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setCreated($arr[$keys[5]]);
     }
 }
Example #3
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');
 }
Example #4
0
 public function getNgTestApplScoresJoinNgTestApplSched($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseNgTestApplScorePeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collNgTestApplScores === null) {
         if ($this->isNew()) {
             $this->collNgTestApplScores = array();
         } else {
             $criteria->add(NgTestApplScorePeer::NG_TEST_SUBJECT_ID, $this->getId());
             $this->collNgTestApplScores = NgTestApplScorePeer::doSelectJoinNgTestApplSched($criteria, $con);
         }
     } else {
         $criteria->add(NgTestApplScorePeer::NG_TEST_SUBJECT_ID, $this->getId());
         if (!isset($this->lastNgTestApplScoreCriteria) || !$this->lastNgTestApplScoreCriteria->equals($criteria)) {
             $this->collNgTestApplScores = NgTestApplScorePeer::doSelectJoinNgTestApplSched($criteria, $con);
         }
     }
     $this->lastNgTestApplScoreCriteria = $criteria;
     return $this->collNgTestApplScores;
 }