public static function getKi4($department = false) { if (!$department) { return false; } if (!$department->getId()) { return false; } $criteria = new Criteria(); $criteria->add(GradeConversionTemplatePeer::CUR13_KI_ID, ScoreRule::FOUR); $criteria->add(GradeConversionTemplatePeer::DEPARTMENT_ID, $department->getId(), Criteria::EQUAL); return GradeConversionTemplatePeer::doSelectOne($criteria); }
public static function doSelectJoinAllExceptCourseSchedule(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } Cur13TermPeer::addSelectColumns($c); $startcol2 = Cur13TermPeer::NUM_COLUMNS - Cur13TermPeer::NUM_LAZY_LOAD_COLUMNS + 1; Cur13KiPeer::addSelectColumns($c); $startcol3 = $startcol2 + Cur13KiPeer::NUM_COLUMNS; GradeConversionTemplatePeer::addSelectColumns($c); $startcol4 = $startcol3 + GradeConversionTemplatePeer::NUM_COLUMNS; $c->addJoin(Cur13TermPeer::CUR13_KI_ID, Cur13KiPeer::ID); $c->addJoin(Cur13TermPeer::GRADE_CONVERSION_TEMPLATE_ID, GradeConversionTemplatePeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = Cur13TermPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = Cur13KiPeer::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->getCur13Ki(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addCur13Term($obj1); break; } } if ($newObject) { $obj2->initCur13Terms(); $obj2->addCur13Term($obj1); } $omClass = GradeConversionTemplatePeer::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->getGradeConversionTemplate(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addCur13Term($obj1); break; } } if ($newObject) { $obj3->initCur13Terms(); $obj3->addCur13Term($obj1); } $results[] = $obj1; } return $results; }
public function getGradeConversionTemplate($con = null) { include_once 'lib/model/om/BaseGradeConversionTemplatePeer.php'; if ($this->aGradeConversionTemplate === null && $this->grade_conversion_template_id !== null) { $this->aGradeConversionTemplate = GradeConversionTemplatePeer::retrieveByPK($this->grade_conversion_template_id, $con); } return $this->aGradeConversionTemplate; }
/** * prepareConversion function * function to get gradeConversionTemplate based on KI and department, and then set it to $this->gradeConversionTemplate * Have to set department and KI before call this function * @return array */ public function prepareConversion() { $this->gradeConversionTemplate = GradeConversionTemplatePeer::getTemplateByKi($this->getDepartment(), $this->getKi()->getId()); if (!$this->gradeConversionTemplate) { return false; } $c = new Criteria(); $c->add(GradeConversionPeer::GRADE_CONVERSION_TEMPLATE_ID, $this->gradeConversionTemplate->getId(), Criteria::EQUAL); $this->gradeConversions = GradeConversionPeer::doSelect($c); if ($this->gradeConversions) { return true; } else { return false; } }
public function prepareConversionKi4() { $this->gradeConversionTemplateKi1 = GradeConversionTemplatePeer::getKi4($this->department); if (!$this->gradeConversionTemplateKi1) { return false; } $c = new Criteria(); $c->add(GradeConversionPeer::GRADE_CONVERSION_TEMPLATE_ID, $this->gradeConversionTemplateKi4->getId(), Criteria::EQUAL); $this->gradeConversionKi4 = GradeConversionPeer::doSelect($c); if ($this->gradeConversionKi4) { return true; } else { return false; } }
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(GradeConversionTemplatePeer::ID, $pks, Criteria::IN); $objs = GradeConversionTemplatePeer::doSelect($criteria, $con); } return $objs; }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = GradeConversionTemplatePeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setCur13KiId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setDepartmentId($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setCode($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setName($arr[$keys[4]]); } }