Ejemplo n.º 1
0
 /**
  * This function archives the specified users in course's lessons
  *
  * @param array $users The users to archive
  * @since 3.6.3
  * @access private
  */
 private function archiveUsersInCourseLessons($users)
 {
     if (sizeof($users) == 1) {
         $key = key($users);
         $lessonsToCourses = EfrontLesson::countLessonsOccurencesInCoursesForUser($users[$key]);
     } else {
         $lessonsToCourses = EfrontLesson::countLessonsOccurencesInCoursesForAllUsers();
     }
     foreach ($this->getCourseLessons() as $lesson) {
         $usersToArchive = array();
         foreach ($users as $user) {
             if ($lessonsToCourses[$user][$lesson->lesson['id']] == 1) {
                 $usersToArchive[] = $user;
             }
         }
         $lesson->archiveLessonUsers($usersToArchive);
     }
 }