private function getMother($applicant) { $motherCrit = new Criteria(); $motherCrit->add(TestApplicantParentsPeer::TEST_APPLICANT_ID, $applicant->getId(), Criteria::EQUAL); $motherCrit->add(TestApplicantParentsPeer::RELATION, StudentParents::RELATION_MOTHER, Criteria::EQUAL); $mother = TestApplicantParentsPeer::doSelectOne($motherCrit); return $mother; }
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(TestApplicantParentsPeer::ID, $pks, Criteria::IN); $objs = TestApplicantParentsPeer::doSelect($criteria, $con); } return $objs; }
public function executeGraduateReceipt() { $ta_id = $this->getRequestParameter('id'); $ta = TestApplicantPeer::retrieveByPK($ta_id); $this->forward404Unless($ta); $this->ta = $ta; $this->ta_detail = $ta->getTestApplicantDetail(); $ta_detail = $ta->getTestApplicantDetail(); $this->ta_detail = $ta_detail; $cw = new Criteria(); $cw->add(DepartmentDetailPeer::DEPARTMENT_ID, $ta->getDepartment1()); $this->department_detail = DepartmentDetailPeer::doSelectOne($cw); $cm = new Criteria(); $cm->add(TestApplicantParentsPeer::TEST_APPLICANT_ID, $ta->getId()); $cm->add(TestApplicantParentsPeer::RELATION, StudentParents::RELATION_FATHER); $father = TestApplicantParentsPeer::doSelectOne($cm); if ($father == null) { $father = new TestApplicantParents(); } $cl = new Criteria(); $cl->add(TestApplicantParentsPeer::TEST_APPLICANT_ID, $ta->getId()); $cl->add(TestApplicantParentsPeer::RELATION, StudentParents::RELATION_MOTHER); $mother = TestApplicantParentsPeer::doSelectOne($cl); if ($mother == null) { $mother = new TestApplicantParents(); } $c = new Criteria(); $c->add(TestApplSchedPeer::TEST_APPLICANT_ID, $ta->getId()); $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $ta->getDepartment1()); $c->addJoin(AcademicCalendarPeer::ID, RegPeriodPeer::ACADEMIC_CALENDAR_ID); $c->addJoin(RegPeriodPeer::ID, RegTestPeriodPeer::REG_PERIOD_ID); $c->addJoin(RegTestPeriodPeer::ID, TestSchedulePeer::REG_TEST_PERIOD_ID); $c->addJoin(TestSchedulePeer::ID, TestApplSchedPeer::TEST_SCHEDULE_ID); $appl_sched1 = TestApplSchedPeer::doSelectJoinTestSchedule($c); $this->setTemplate('graduateReceipt'); $this->papersize = 'a4'; $this->father = $father; $this->mother = $mother; $this->sched1 = $appl_sched1; $this->orientation = 'portrait'; $this->setLayout(false); $this->setViewClass('sfDomPDF'); }
public function executeEdit() { if ($this->getUser()->isAuthenticated2('bo')) { $user_id = $this->getContext()->getUser()->getAttribute('user_id', null, 'bo'); $applicant = TestApplicantPeer::retrieveByPk($user_id); $this->forward404Unless($applicant); $this->applicant_detail = $applicant->getTestApplicantDetail(); $this->applicant = $applicant; $cm = new Criteria(); $cm->add(TestApplicantParentsPeer::TEST_APPLICANT_ID, $applicant->getId()); $cm->add(TestApplicantParentsPeer::RELATION, StudentParents::RELATION_FATHER); $father = TestApplicantParentsPeer::doSelectOne($cm); $cl = new Criteria(); $cl->add(TestApplicantParentsPeer::TEST_APPLICANT_ID, $applicant->getId()); $cl->add(TestApplicantParentsPeer::RELATION, StudentParents::RELATION_MOTHER); $mother = TestApplicantParentsPeer::doSelectOne($cl); $this->father = $father; $this->mother = $mother; $this->sudahAngket = $this->isSudahAngket($applicant); } else { $this->redirect('default/index'); } }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = TestApplicantParentsPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setTestApplicantId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setName($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setPob($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setDob($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setReligionId($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setCountryId($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { $this->setDegreeId($arr[$keys[7]]); } if (array_key_exists($keys[8], $arr)) { $this->setJob($arr[$keys[8]]); } if (array_key_exists($keys[9], $arr)) { $this->setMonthlyRevenue($arr[$keys[9]]); } if (array_key_exists($keys[10], $arr)) { $this->setAddress($arr[$keys[10]]); } if (array_key_exists($keys[11], $arr)) { $this->setRegionId($arr[$keys[11]]); } if (array_key_exists($keys[12], $arr)) { $this->setPostCode($arr[$keys[12]]); } if (array_key_exists($keys[13], $arr)) { $this->setHomePhone($arr[$keys[13]]); } if (array_key_exists($keys[14], $arr)) { $this->setOfficePhone($arr[$keys[14]]); } if (array_key_exists($keys[15], $arr)) { $this->setCellphone($arr[$keys[15]]); } if (array_key_exists($keys[16], $arr)) { $this->setEmail($arr[$keys[16]]); } if (array_key_exists($keys[17], $arr)) { $this->setRelation($arr[$keys[17]]); } if (array_key_exists($keys[18], $arr)) { $this->setNote($arr[$keys[18]]); } if (array_key_exists($keys[19], $arr)) { $this->setNoteDate($arr[$keys[19]]); } if (array_key_exists($keys[20], $arr)) { $this->setNoteDetail($arr[$keys[20]]); } }