/** * Called when this course has been updated in any way that should be * broadcast to all students and professors in the class. */ public function perform_sync() { // Let's make sure we have the users $this->getCourseUsers(); // Go through all of the students and professors foreach ($this->users as $user) { Sync::emit($user, 'course', $this->getCourseId(), $this->getContext($user)); } foreach ($this->professors as $user) { Sync::emit($user, 'course', $this->getCourseId(), $this->getContext($user)); } // Sync to all admins foreach (User::admins() as $user) { Sync::emit($user, 'course', $this->getCourseId(), $this->getContext($user)); } }