private function create_enrollment($row, $isEager)
 {
     $obj = new Enrollment();
     $obj->setStudentId($row["student_Id"]);
     $obj->setCourseNumber($row["courseNumber"]);
     $obj->setRegistrationDate(new \DateTime($row["registrationDate"]));
     $obj->setSemester($row["semester"]);
     $obj->setYear($row["year"]);
     if ($isEager) {
         $courseDao = new CourseDAO();
         $studentDap = new StudentDAO();
         $obj->setCourse($courseDao->getCourseById($row["courseNumber"]));
         $obj->setStudent($studentDap->getStudentById($row["student_Id"]));
     }
     return $obj;
 }
Example #2
0
 public function testDelete()
 {
     $dao = new CourseDAO();
     $crs = $dao->getCourseById("091");
     assert($dao->deleteCourse($crs));
 }