Ejemplo n.º 1
0
 protected function getInsAssocListFromDB(Instructor $instructor = null)
 {
     // declare empty array
     $this->assocData = array();
     for ($i = $this->date["year"] + 1; $i >= $this->earliestYear; $i--) {
         for ($j = 1; $j <= 9; $j += 4) {
             $this->assocData[$i . $j] = "";
         }
     }
     // get data from db
     if (isset($instructor)) {
         $crit = new Criteria();
         $crit->addAscendingOrderByColumn(CourseInstructorAssociationPeer::YEAR);
         $crit->addAscendingOrderByColumn(CourseInstructorAssociationPeer::COURSE_ID);
         $rawList = $instructor->getCourseInstructorAssociationsJoinCourse($crit);
         // parse out raw data string to client
         foreach ($rawList as $obj) {
             $year = $obj->getYear();
             $this->assocData[$year] .= $obj->getCourseId() . " (" . $obj->getCourse()->getDescr() . ")" . $this->separator;
         }
     }
 }