private function findSubjectDetails($subject_id) { $subject = new Acad_Model_Subject(); $subject->setSubject_id($subject_id); $info = $subject->fetchInfo(); if ($info instanceof Acad_Model_Subject) { $subject_info = array(); $subject_info['subject_code'] = $info->getSubject_code(); $subject_info['abbr'] = $info->getAbbr(); $subject_info['subject_name'] = $info->getSubject_name(); $subject_info['subject_type_id'] = $info->getSubject_type_id(); $subject_info['is_optional'] = $info->getIs_optional(); $subject_info['lecture_per_week'] = $info->getLecture_per_week(); $subject_info['tutorial_per_week'] = $info->getTutorial_per_week(); $subject_info['practical_per_week'] = $info->getPractical_per_week(); $subject_info['suggested_duration'] = $info->getSuggested_duration(); return $subject_info; } else { return false; } }
private function fetchSubjectInfo($subject_id) { $subject = new Acad_Model_Subject(); $subject->setSubject_id($subject_id); $info = $subject->fetchInfo(); if ($info == false) { $subject_info = false; } elseif ($info instanceof Acad_Model_Subject) { $subject_info = array(); $subject_info['name'] = $subject->getSubject_name(); $subject_info['code'] = $subject->getSubject_code(); } return $subject_info; }