/**
  * The cleanup command
  *
  * @return void
  */
 public function cleanupCommand()
 {
     $fullSettings = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT, 'SfEventMgt', 'Pievent');
     $settings = $fullSettings['plugin.']['tx_sfeventmgt.']['settings.'];
     $this->registrationService->handleExpiredRegistrations($settings['registration.']['deleteExpiredRegistrations']);
     // Clear cache for configured pages
     $this->utilityService->clearCacheForConfiguredUids($settings);
 }
 /**
  * Test for clearCacheForConfiguredUids with empty settings
  *
  * @test
  * @return void
  */
 public function clearCacheForConfiguredUidsWithSettingsTest()
 {
     $settings = array('clearCacheUids' => '1,2,3,4');
     $settingsService = $this->getMock('DERHANSEN\\SfEventMgt\\Service\\SettingsService', array(), array(), '', FALSE);
     $settingsService->expects($this->once())->method('getClearCacheUids')->with($settings)->will($this->returnValue(array(1, 2, 3, 4)));
     $this->inject($this->subject, 'settingsService', $settingsService);
     $cacheService = $this->getMock('TYPO3\\CMS\\Extbase\\Service\\CacheService', array(), array(), '', FALSE);
     $cacheService->expects($this->once())->method('clearPageCache')->with(array(1, 2, 3, 4));
     $this->inject($this->subject, 'cacheService', $cacheService);
     $this->subject->clearCacheForConfiguredUids($settings);
 }
 /**
  * Cancels the registration if possible and sends e-mails to admin and user
  *
  * @param int $reguid UID of registration
  * @param string $hmac HMAC for parameters
  *
  * @return void
  */
 public function cancelRegistrationAction($reguid, $hmac)
 {
     /* @var $registration Registration */
     list($failed, $registration, $messageKey, $titleKey) = $this->registrationService->checkCancelRegistration($reguid, $hmac);
     if ($failed === false) {
         // Send notifications (must run before cancelling the registration)
         $this->notificationService->sendUserMessage($registration->getEvent(), $registration, $this->settings, MessageType::REGISTRATION_CANCELLED);
         $this->notificationService->sendAdminMessage($registration->getEvent(), $registration, $this->settings, MessageType::REGISTRATION_CANCELLED);
         // First cancel depending registrations
         if ($registration->getAmountOfRegistrations() > 1) {
             $this->registrationService->cancelDependingRegistrations($registration);
         }
         // Finally cancel registration
         $this->registrationRepository->remove($registration);
         // Clear cache for configured pages
         $this->utilityService->clearCacheForConfiguredUids($this->settings);
     }
     $this->view->assign('messageKey', $messageKey);
     $this->view->assign('titleKey', $titleKey);
 }