public function __construct(CourseSession $session, User $user) { $course = $session->getCourse(); $details = array(); $details['username'] = $user->getUsername(); $details['firsName'] = $user->getFirstName(); $details['lastName'] = $user->getLastName(); $details['sessionId'] = $session->getId(); $details['sessionName'] = $session->getName(); $details['sessionCreationDate'] = $session->getCreationDate()->format('d/m/Y H:i:s'); $details['courseId'] = $course->getId(); $details['courseTitle'] = $course->getTitle(); $details['courseCode'] = $course->getCode(); parent::__construct(self::ACTION, $details, $user); }
public function __construct(CourseSession $session) { $course = $session->getCourse(); $workspace = $session->getWorkspace(); $learnerRole = $session->getLearnerRole(); $tutorRole = $session->getTutorRole(); $details = []; $details['id'] = $session->getId(); $details['name'] = $session->getName(); $details['defaultSession'] = $session->isDefaultSession(); $details['creationDate'] = $session->getCreationDate(); $details['publicRegistration'] = $session->getPublicRegistration(); $details['publicUnregistration'] = $session->getPublicUnregistration(); $details['registrationValidation'] = $session->getRegistrationValidation(); $details['startDate'] = $session->getStartDate(); $details['endDate'] = $session->getEndDate(); $details['extra'] = $session->getExtra(); $details['userValidation'] = $session->getUserValidation(); $details['organizationValidation'] = $session->getOrganizationValidation(); $details['maxUsers'] = $session->getMaxUsers(); $details['type'] = $session->getType(); $details['courseId'] = $course->getId(); $details['courseTitle'] = $course->getTitle(); $details['courseCode'] = $course->getCode(); if (!is_null($workspace)) { $details['workspaceId'] = $workspace->getId(); $details['workspaceName'] = $workspace->getName(); $details['workspaceCode'] = $workspace->getCode(); $details['workspaceGuid'] = $workspace->getGuid(); } if (!is_null($learnerRole)) { $details['learnerRoleId'] = $learnerRole->getId(); $details['learnerRoleName'] = $learnerRole->getName(); $details['learnerRoleKey'] = $learnerRole->getTranslationKey(); } if (!is_null($tutorRole)) { $details['tutorRoleId'] = $tutorRole->getId(); $details['tutorRoleName'] = $tutorRole->getName(); $details['tutorRoleKey'] = $tutorRole->getTranslationKey(); } parent::__construct(self::ACTION, $details); }
public function deleteCourseSession(CourseSession $session, $withWorkspace = false) { $course = $session->getCourse(); $workspace = $session->getWorkspace(); $learnerRole = $session->getLearnerRole(); $tutorRole = $session->getTutorRole(); $details = []; $details['id'] = $session->getId(); $details['name'] = $session->getName(); $details['defaultSession'] = $session->isDefaultSession(); $details['creationDate'] = $session->getCreationDate(); $details['publicRegistration'] = $session->getPublicRegistration(); $details['publicUnregistration'] = $session->getPublicUnregistration(); $details['registrationValidation'] = $session->getRegistrationValidation(); $details['startDate'] = $session->getStartDate(); $details['endDate'] = $session->getEndDate(); $details['extra'] = $session->getExtra(); $details['userValidation'] = $session->getUserValidation(); $details['organizationValidation'] = $session->getOrganizationValidation(); $details['maxUsers'] = $session->getMaxUsers(); $details['type'] = $session->getType(); $details['courseId'] = $course->getId(); $details['courseTitle'] = $course->getTitle(); $details['courseCode'] = $course->getCode(); if (!is_null($workspace)) { $details['workspaceId'] = $workspace->getId(); $details['workspaceName'] = $workspace->getName(); $details['workspaceCode'] = $workspace->getCode(); $details['workspaceGuid'] = $workspace->getGuid(); } if (!is_null($learnerRole)) { $details['learnerRoleId'] = $learnerRole->getId(); $details['learnerRoleName'] = $learnerRole->getName(); $details['learnerRoleKey'] = $learnerRole->getTranslationKey(); } if (!is_null($tutorRole)) { $details['tutorRoleId'] = $tutorRole->getId(); $details['tutorRoleName'] = $tutorRole->getName(); $details['tutorRoleKey'] = $tutorRole->getTranslationKey(); } $this->om->startFlushSuite(); $workspace = $session->getWorkspace(); $this->om->remove($session); if ($withWorkspace && !is_null($workspace)) { $this->om->remove($tutorRole); $this->om->remove($learnerRole); $this->workspaceManager->deleteWorkspace($workspace); } $event = new LogCourseSessionDeleteEvent($details); $this->eventDispatcher->dispatch('log', $event); $this->om->endFlushSuite(); }