Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 18th, 2010 | Syntax: None | Size: 0.41 KB | Hits: 43 | Expires: Never
Copy text to clipboard
  1.         public function saveAll(Course $Course, CourseGoals $CourseGoals){
  2.                 // delete the existing course goals and add the array of new ones for a course
  3.                 $current = $this->findCourseGoalsByCourse($Course);
  4.                 $new = $CourseGoals;
  5.                 foreach ($current as $deletegoal=>$goal){
  6.                         $this->delete($Course,$goal[0]);
  7.                 }
  8.                 $i = 0;
  9.                 foreach ($new as $newgoal=>$goal){
  10.                         $this->save($Course,$goal[$i]);
  11.                         $i++;
  12.                 }
  13.         }