private function saveUser($userId, $name, $sortableName, $avatar = null)
 {
     $user = User::firstOrNew(array('user_id' => $userId));
     $user->user_id = $userId;
     $user->name = $name;
     $user->sortable_name = $sortableName;
     if (!is_null($avatar)) {
         $user->avatar = $avatar;
     }
     $user->save();
     return $user;
 }
Example #2
0
 private function processStudentsInCourse($data, $courseId)
 {
     foreach ($data as $row) {
         $student = User::firstOrNew(array('user_id' => $row->id, 'course_id' => $courseId));
         return $student;
     }
 }