Exemplo n.º 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');
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 public function getNgTestApplScores($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());
             NgTestApplScorePeer::addSelectColumns($criteria);
             $this->collNgTestApplScores = NgTestApplScorePeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(NgTestApplScorePeer::NG_TEST_SUBJECT_ID, $this->getId());
             NgTestApplScorePeer::addSelectColumns($criteria);
             if (!isset($this->lastNgTestApplScoreCriteria) || !$this->lastNgTestApplScoreCriteria->equals($criteria)) {
                 $this->collNgTestApplScores = NgTestApplScorePeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastNgTestApplScoreCriteria = $criteria;
     return $this->collNgTestApplScores;
 }