public function executeGetApplSched() { $this->ng_reg_period = NgRegPeriodPeer::retrieveByPK($this->getRequestParameter('ng_reg_period_id')); $this->forward404Unless($this->ng_reg_period); $this->ng_reg_test_period = NgRegTestPeriodPeer::retrieveByPK($this->getRequestParameter('ng_reg_test_period_id')); $this->forward404Unless($this->ng_reg_test_period); $this->ng_test_schedule = NgTestSchedulePeer::retrieveByPK($this->getRequestParameter('ng_test_schedule_id')); $this->forward404Unless($this->ng_test_schedule); $ct = new Criteria(); $ct->add(NgTestSubjectPeer::COURSE_MODEL, DepartmentPeer::retrieveByPK($this->ng_reg_period->getAcademicCalendar()->getDepartmentId())->getCourseModel()); $this->test_subjects = NgTestSubjectPeer::doSelect($ct); $c = new Criteria(); $c->add(NgTestApplSchedPeer::NG_TEST_SCHEDULE_ID, $this->ng_test_schedule->getId()); $c->addJoin(NgTestApplicantPeer::ID, NgTestApplSchedPeer::NG_TEST_APPLICANT_ID); $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'applicant')); $this->getUser()->setAttribute('max_per_page', $rpp, 'applicant'); $pager = new sfPropelPager('NgTestApplicant', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'applicant')); $this->getUser()->setAttribute('page', $page, 'applicant'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $this->type = 'edit'; $this->actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'cancel', 'url' => 'ng_reg_detail/listTest?id=' . $this->ng_reg_period->getId(), 'color' => 'black')); }
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(NgTestSubjectPeer::ID, $pks, Criteria::IN); $objs = NgTestSubjectPeer::doSelect($criteria, $con); } return $objs; }