示例#1
0
文件: baseKi.php 项目: taryono/school
 /**
  * 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;
     }
 }