Exemple #1
0
 public function executePrintAbsensi()
 {
     $testId = $this->getRequestParameter('id');
     $this->forward404Unless($testId);
     $test = TestSchedulePeer::retrieveByPK($testId);
     $this->forward404Unless($test);
     $c = new Criteria();
     $c->add(TestApplSchedPeer::TEST_SCHEDULE_ID, $test->getId());
     $applicant = TestApplSchedPeer::doSelect($c);
     $this->applicant = $applicant;
     $this->applicantCount = TestApplSchedPeer::doCount($c);
     $this->test = $test;
     $this->papersize = 'a4';
     $this->orientation = 'potrait';
     if (SF_ENVIRONMENT != 'dev') {
         $this->setViewClass('sfDomPDF');
     }
 }
 public static function retrieveByPK($test_applicant_id, $test_schedule_id, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $criteria = new Criteria();
     $criteria->add(TestApplSchedPeer::TEST_APPLICANT_ID, $test_applicant_id);
     $criteria->add(TestApplSchedPeer::TEST_SCHEDULE_ID, $test_schedule_id);
     $v = TestApplSchedPeer::doSelect($criteria, $con);
     return !empty($v) ? $v[0] : null;
 }
Exemple #3
0
 public function getTestApplScheds($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseTestApplSchedPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collTestApplScheds === null) {
         if ($this->isNew()) {
             $this->collTestApplScheds = array();
         } else {
             $criteria->add(TestApplSchedPeer::TEST_APPLICANT_ID, $this->getId());
             TestApplSchedPeer::addSelectColumns($criteria);
             $this->collTestApplScheds = TestApplSchedPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(TestApplSchedPeer::TEST_APPLICANT_ID, $this->getId());
             TestApplSchedPeer::addSelectColumns($criteria);
             if (!isset($this->lastTestApplSchedCriteria) || !$this->lastTestApplSchedCriteria->equals($criteria)) {
                 $this->collTestApplScheds = TestApplSchedPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastTestApplSchedCriteria = $criteria;
     return $this->collTestApplScheds;
 }