Example #1
0
 /**
  * Get Faculty Subjects in hand
  * @param Acad_Model_Member_Faculty $faculty
  * @param Acad_Model_Class|Acad_Model_Department $viewLevel = null
  * @param bool $showModes = null
  * @return array
  */
 public function fetchInHandSubjects(Acad_Model_Member_Faculty $faculty, $viewLevel = NULL, $showModes = NULL)
 {
     $select = $this->getDbTable()->getAdapter()->select();
     $select->distinct()->from('period_attendance2', array('subject_code', 'department_id', 'programme_id', 'semester_id'))->where('faculty_id = ?', $faculty->getMemberId());
     if (isset($showModes)) {
         $select->columns('subject_mode_id');
     }
     if ($viewLevel instanceof Acad_Model_Class) {
         $select->where('department_id = ?', $viewLevel->getDepartment())->where('programme_id = ?', $viewLevel->getProgramme_id())->where('semester_id = ?', $viewLevel->getSemester());
     } elseif ($viewLevel instanceof Acad_Model_Department) {
         $select->where('department_id = ?', $viewLevel->getDepartment());
     }
     return $select->query()->fetchAll(Zend_Db::FETCH_GROUP);
 }
Example #2
0
 /**
  * 
  * Enter description here ...
  * @param Acad_Model_Class $class
  * @FIXME It is not complete
  */
 public function save(Acad_Model_Class $class)
 {
     $data = array('department_id' => $class->getDepartment(), 'degree_id' => $class->getProgramme_id(), 'batchstart' => $class->getBatchStart());
 }