예제 #1
0
 /**
  * lay du lieu tu object tra ve mot mang
  * @param Teacher_Model_Teacher $teacher
  * @return array $data
  */
 private function __getDataFormObjectTeacher(Teacher_Model_Teacher $teacher)
 {
     $data['teacherId'] = $teacher->getTeacherId();
     $data['teacherName'] = $teacher->getTeacherName();
     $data['dateOfBirth'] = $teacher->getDateOfBirth();
     $data['gender'] = $teacher->getGender();
     $data['diploma'] = $teacher->getDiploma();
     $data['phone'] = $teacher->getPhone();
     $data['address'] = $teacher->getAddress();
     $data['role'] = $teacher->getRole();
     $data['avatar'] = $teacher->getAvatar() ? $teacher->getAvatar() : realpath(APPLICATION_PATH . '/../public/images/avatar/defaultAvatar.png');
     return $data;
 }
예제 #2
0
 /**
  * display form update
  * @param Teacher_Form_UpdateProfile $form
  * @param Teacher_Model_Teacher $result
  */
 protected function _processShowForm(Teacher_Form_UpdateProfile $form, Teacher_Model_Teacher $result)
 {
     $form->populate(['teacherId' => $result->getTeacherId(), 'teacherName' => $result->getTeacherName(), 'dateOfBirth' => $result->getDateOfBirth(), 'diploma' => $result->getDiploma(), 'gender' => $result->getGender(), 'phone' => $result->getPhone(), 'address' => $result->getAddress(), 'role' => $result->getRole()]);
 }