Ejemplo n.º 1
0
 /**
  * 
  * @desc assigns subjects to a student 
  * @desc (i-e the subjects that the student is supposed to studty)
  * @param int $class_id
  * @param array $subject_ids
  */
 public function assignSubjects($class_id, $subject_ids)
 {
     $student_subject = new Acad_Model_StudentSubject();
     $member_id = $this->getMember_id(true);
     $student_subject->setMember_id($member_id);
     $all_class_ids = $this->fetchAllClassIds();
     if (in_array($class_id, $all_class_ids)) {
         $student_subject->setClass_id($class_id);
         return $student_subject->assignSubjects($subject_ids);
     } else {
         return false;
     }
 }
Ejemplo n.º 2
0
 /**
  * CHANGE OF CONCEPT , NOW WE DONT NEED CLASS_ID AS PARAMETER
  * Enter description here ...
  * @param int $dmc_info_id
  * @param int $member_id
  */
 private function fetchDMC($dmc_info_id, $member_id)
 {
     $subject_data = array();
     $dmc_info_raw = array();
     $dmc_info_raw = self::fetchDmcInfo($member_id, $dmc_info_id);
     $student_subject = new Acad_Model_StudentSubject();
     $student_subject->setMember_id($member_id);
     $dmc_info_data = array_pop($dmc_info_raw);
     $class_id = $dmc_info_data['class_id'];
     $student_subject->setClass_id($class_id);
     $subject_ids = $student_subject->fetchSubjects();
     $student_subject_ids = array_keys($subject_ids);
     $dmc_subject_data = self::fetchDmcSubjectMarks($member_id, $dmc_info_id, $student_subject_ids);
     $subject_data = $this->fetchStudentSubjects($class_id, $member_id);
     $response = array('dmc_info_data' => $dmc_info_data, 'dmc_data' => $dmc_subject_data, 'subject_data' => $subject_data);
     return $response;
 }