public function executeSelectClassByDept() { $dept_id = $this->getRequestParameter('department_id'); $department = DepartmentPeer::retrieveByPK($dept_id); $c = new Criteria(); $c->add(ClassLevelPeer::COURSE_MODEL, $department->getCourseModel()); $objs = ClassLevelPeer::doSelect($c); ksort($objs); $content = array(); foreach ($objs as $r) { $content[$r->getId()] = $r->getName(); } $this->content = $content; $this->disabled = $disabled; }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = ClassLevelPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setCode($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setName($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setCourseModel($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setOrdered($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setCreated($arr[$keys[5]]); } }
public static function doSelectJoinAllExceptSubjectCurr(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } Cur13SubjectDescriptionPeer::addSelectColumns($c); $startcol2 = Cur13SubjectDescriptionPeer::NUM_COLUMNS - Cur13SubjectDescriptionPeer::NUM_LAZY_LOAD_COLUMNS + 1; ClassLevelPeer::addSelectColumns($c); $startcol3 = $startcol2 + ClassLevelPeer::NUM_COLUMNS; Cur13KiPeer::addSelectColumns($c); $startcol4 = $startcol3 + Cur13KiPeer::NUM_COLUMNS; $c->addJoin(Cur13SubjectDescriptionPeer::CLASS_LEVEL_ID, ClassLevelPeer::ID); $c->addJoin(Cur13SubjectDescriptionPeer::CUR13_KI_ID, Cur13KiPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = Cur13SubjectDescriptionPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = ClassLevelPeer::getOMClass(); $cls = Propel::import($omClass); $obj2 = new $cls(); $obj2->hydrate($rs, $startcol2); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj2 = $temp_obj1->getClassLevel(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addCur13SubjectDescription($obj1); break; } } if ($newObject) { $obj2->initCur13SubjectDescriptions(); $obj2->addCur13SubjectDescription($obj1); } $omClass = Cur13KiPeer::getOMClass(); $cls = Propel::import($omClass); $obj3 = new $cls(); $obj3->hydrate($rs, $startcol3); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj3 = $temp_obj1->getCur13Ki(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addCur13SubjectDescription($obj1); break; } } if ($newObject) { $obj3->initCur13SubjectDescriptions(); $obj3->addCur13SubjectDescription($obj1); } $results[] = $obj1; } return $results; }
public function getClassLevel($con = null) { include_once 'lib/model/om/BaseClassLevelPeer.php'; if ($this->aClassLevel === null && $this->class_level_id !== null) { $this->aClassLevel = ClassLevelPeer::retrieveByPK($this->class_level_id, $con); } return $this->aClassLevel; }
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(ClassLevelPeer::ID, $pks, Criteria::IN); $objs = ClassLevelPeer::doSelect($criteria, $con); } return $objs; }
public static function doSelectJoinAllExceptSubdistrict(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } NgTestApplicantPeer::addSelectColumns($c); $startcol2 = NgTestApplicantPeer::NUM_COLUMNS - NgTestApplicantPeer::NUM_LAZY_LOAD_COLUMNS + 1; NgRegInfoPeer::addSelectColumns($c); $startcol3 = $startcol2 + NgRegInfoPeer::NUM_COLUMNS; DepartmentPeer::addSelectColumns($c); $startcol4 = $startcol3 + DepartmentPeer::NUM_COLUMNS; ClassLevelPeer::addSelectColumns($c); $startcol5 = $startcol4 + ClassLevelPeer::NUM_COLUMNS; NgRegTestPeriodPeer::addSelectColumns($c); $startcol6 = $startcol5 + NgRegTestPeriodPeer::NUM_COLUMNS; NgStatusApplicantPeer::addSelectColumns($c); $startcol7 = $startcol6 + NgStatusApplicantPeer::NUM_COLUMNS; NgApplicantCategoryPeer::addSelectColumns($c); $startcol8 = $startcol7 + NgApplicantCategoryPeer::NUM_COLUMNS; CountryPeer::addSelectColumns($c); $startcol9 = $startcol8 + CountryPeer::NUM_COLUMNS; ReligionPeer::addSelectColumns($c); $startcol10 = $startcol9 + ReligionPeer::NUM_COLUMNS; RegionPeer::addSelectColumns($c); $startcol11 = $startcol10 + RegionPeer::NUM_COLUMNS; CityPeer::addSelectColumns($c); $startcol12 = $startcol11 + CityPeer::NUM_COLUMNS; DistrictPeer::addSelectColumns($c); $startcol13 = $startcol12 + DistrictPeer::NUM_COLUMNS; ClassLevelPeer::addSelectColumns($c); $startcol14 = $startcol13 + ClassLevelPeer::NUM_COLUMNS; $c->addJoin(NgTestApplicantPeer::NG_REG_INFO_ID, NgRegInfoPeer::ID); $c->addJoin(NgTestApplicantPeer::DEPARTMENT_ID, DepartmentPeer::ID); $c->addJoin(NgTestApplicantPeer::CLASS_LEVEL_ID, ClassLevelPeer::ID); $c->addJoin(NgTestApplicantPeer::NG_REG_TEST_PERIOD_ID, NgRegTestPeriodPeer::ID); $c->addJoin(NgTestApplicantPeer::NG_STATUS_APPLICANT_ID, NgStatusApplicantPeer::ID); $c->addJoin(NgTestApplicantPeer::NG_APPLICANT_CATEGORY_ID, NgApplicantCategoryPeer::ID); $c->addJoin(NgTestApplicantPeer::COUNTRY_ID, CountryPeer::ID); $c->addJoin(NgTestApplicantPeer::RELIGION_ID, ReligionPeer::ID); $c->addJoin(NgTestApplicantPeer::REGION_ID, RegionPeer::ID); $c->addJoin(NgTestApplicantPeer::CITY_ID, CityPeer::ID); $c->addJoin(NgTestApplicantPeer::DISTRICT_ID, DistrictPeer::ID); $c->addJoin(NgTestApplicantPeer::LAST_CLASS, ClassLevelPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = NgTestApplicantPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = NgRegInfoPeer::getOMClass(); $cls = Propel::import($omClass); $obj2 = new $cls(); $obj2->hydrate($rs, $startcol2); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj2 = $temp_obj1->getNgRegInfo(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addNgTestApplicant($obj1); break; } } if ($newObject) { $obj2->initNgTestApplicants(); $obj2->addNgTestApplicant($obj1); } $omClass = DepartmentPeer::getOMClass(); $cls = Propel::import($omClass); $obj3 = new $cls(); $obj3->hydrate($rs, $startcol3); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj3 = $temp_obj1->getDepartment(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addNgTestApplicant($obj1); break; } } if ($newObject) { $obj3->initNgTestApplicants(); $obj3->addNgTestApplicant($obj1); } $omClass = ClassLevelPeer::getOMClass(); $cls = Propel::import($omClass); $obj4 = new $cls(); $obj4->hydrate($rs, $startcol4); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj4 = $temp_obj1->getClassLevelRelatedByClassLevelId(); if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) { $newObject = false; $temp_obj4->addNgTestApplicantRelatedByClassLevelId($obj1); break; } } if ($newObject) { $obj4->initNgTestApplicantsRelatedByClassLevelId(); $obj4->addNgTestApplicantRelatedByClassLevelId($obj1); } $omClass = NgRegTestPeriodPeer::getOMClass(); $cls = Propel::import($omClass); $obj5 = new $cls(); $obj5->hydrate($rs, $startcol5); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj5 = $temp_obj1->getNgRegTestPeriod(); if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) { $newObject = false; $temp_obj5->addNgTestApplicant($obj1); break; } } if ($newObject) { $obj5->initNgTestApplicants(); $obj5->addNgTestApplicant($obj1); } $omClass = NgStatusApplicantPeer::getOMClass(); $cls = Propel::import($omClass); $obj6 = new $cls(); $obj6->hydrate($rs, $startcol6); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj6 = $temp_obj1->getNgStatusApplicant(); if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) { $newObject = false; $temp_obj6->addNgTestApplicant($obj1); break; } } if ($newObject) { $obj6->initNgTestApplicants(); $obj6->addNgTestApplicant($obj1); } $omClass = NgApplicantCategoryPeer::getOMClass(); $cls = Propel::import($omClass); $obj7 = new $cls(); $obj7->hydrate($rs, $startcol7); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj7 = $temp_obj1->getNgApplicantCategory(); if ($temp_obj7->getPrimaryKey() === $obj7->getPrimaryKey()) { $newObject = false; $temp_obj7->addNgTestApplicant($obj1); break; } } if ($newObject) { $obj7->initNgTestApplicants(); $obj7->addNgTestApplicant($obj1); } $omClass = CountryPeer::getOMClass(); $cls = Propel::import($omClass); $obj8 = new $cls(); $obj8->hydrate($rs, $startcol8); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj8 = $temp_obj1->getCountry(); if ($temp_obj8->getPrimaryKey() === $obj8->getPrimaryKey()) { $newObject = false; $temp_obj8->addNgTestApplicant($obj1); break; } } if ($newObject) { $obj8->initNgTestApplicants(); $obj8->addNgTestApplicant($obj1); } $omClass = ReligionPeer::getOMClass(); $cls = Propel::import($omClass); $obj9 = new $cls(); $obj9->hydrate($rs, $startcol9); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj9 = $temp_obj1->getReligion(); if ($temp_obj9->getPrimaryKey() === $obj9->getPrimaryKey()) { $newObject = false; $temp_obj9->addNgTestApplicant($obj1); break; } } if ($newObject) { $obj9->initNgTestApplicants(); $obj9->addNgTestApplicant($obj1); } $omClass = RegionPeer::getOMClass(); $cls = Propel::import($omClass); $obj10 = new $cls(); $obj10->hydrate($rs, $startcol10); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj10 = $temp_obj1->getRegion(); if ($temp_obj10->getPrimaryKey() === $obj10->getPrimaryKey()) { $newObject = false; $temp_obj10->addNgTestApplicant($obj1); break; } } if ($newObject) { $obj10->initNgTestApplicants(); $obj10->addNgTestApplicant($obj1); } $omClass = CityPeer::getOMClass(); $cls = Propel::import($omClass); $obj11 = new $cls(); $obj11->hydrate($rs, $startcol11); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj11 = $temp_obj1->getCity(); if ($temp_obj11->getPrimaryKey() === $obj11->getPrimaryKey()) { $newObject = false; $temp_obj11->addNgTestApplicant($obj1); break; } } if ($newObject) { $obj11->initNgTestApplicants(); $obj11->addNgTestApplicant($obj1); } $omClass = DistrictPeer::getOMClass(); $cls = Propel::import($omClass); $obj12 = new $cls(); $obj12->hydrate($rs, $startcol12); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj12 = $temp_obj1->getDistrict(); if ($temp_obj12->getPrimaryKey() === $obj12->getPrimaryKey()) { $newObject = false; $temp_obj12->addNgTestApplicant($obj1); break; } } if ($newObject) { $obj12->initNgTestApplicants(); $obj12->addNgTestApplicant($obj1); } $omClass = ClassLevelPeer::getOMClass(); $cls = Propel::import($omClass); $obj13 = new $cls(); $obj13->hydrate($rs, $startcol13); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj13 = $temp_obj1->getClassLevelRelatedByLastClass(); if ($temp_obj13->getPrimaryKey() === $obj13->getPrimaryKey()) { $newObject = false; $temp_obj13->addNgTestApplicantRelatedByLastClass($obj1); break; } } if ($newObject) { $obj13->initNgTestApplicantsRelatedByLastClass(); $obj13->addNgTestApplicantRelatedByLastClass($obj1); } $results[] = $obj1; } return $results; }
public function getClassLevelRelatedByLastClass($con = null) { include_once 'lib/model/om/BaseClassLevelPeer.php'; if ($this->aClassLevelRelatedByLastClass === null && $this->last_class !== null) { $this->aClassLevelRelatedByLastClass = ClassLevelPeer::retrieveByPK($this->last_class, $con); } return $this->aClassLevelRelatedByLastClass; }