- public function saveAll(Course $Course, CourseGoals $CourseGoals){
- // delete the existing course goals and add the array of new ones for a course
- $current = $this->findCourseGoalsByCourse($Course);
- $new = $CourseGoals;
- foreach ($current as $deletegoal=>$goal){
- $this->delete($Course,$goal[0]);
- }
- $i = 0;
- foreach ($new as $newgoal=>$goal){
- $this->save($Course,$goal[$i]);
- $i++;
- }
- }
