/** * Initiates the CSV downloads for registrations of the given event uid * * @param int $eventUid EventUid * @param array $settings Settings * * @throws \RuntimeException RuntimeException * @return void */ public function downloadRegistrationsCsv($eventUid, $settings = array()) { $storage = $this->resourceFactory->getDefaultStorage(); if ($storage === NULL) { throw new RuntimeException('Could not get the default storage', 1475590001); } $registrations = $this->exportRegistrationsCsv($eventUid, $settings); $tempFolder = $storage->getFolder('_temp_'); $tempFile = $storage->createFile('sf_events_export.csv', $tempFolder); $tempFile->setContents($registrations); $storage->dumpFileContents($tempFile, TRUE, 'registrations_' . date('dmY_His') . '.csv'); }
/** * Initiates the ICS download for the given event * * @param \DERHANSEN\SfEventMgt\Domain\Model\Event $event The event * * @throws \RuntimeException Exception * * @return void */ public function downloadiCalendarFile(\DERHANSEN\SfEventMgt\Domain\Model\Event $event) { $storage = $this->resourceFactory->getDefaultStorage(); if ($storage === NULL) { throw new \RuntimeException('Could not get the default storage', 1475590001); } $icalContent = $this->getICalendarContent($event); $tempFolder = $storage->getFolder('_temp_'); $tempFile = $storage->createFile('event.ics', $tempFolder); $tempFile->setContents($icalContent); $storage->dumpFileContents($tempFile, TRUE, 'event_' . $event->getUid() . '.ics'); }
/** * Get Category Image folder * * @return \TYPO3\CMS\Core\Resource\Folder|void * @throws \Exception */ protected function getCategoryImageFolder() { if ($this->categoryImageFolder === null) { $storage = $this->resourceFactory->getDefaultStorage(); if (!$storage) { throw new \Exception('No default storage set!'); } try { $this->categoryImageFolder = $storage->getFolder(self::FOLDER_CATEGORY_IMAGES); } catch (\TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException $exception) { $this->categoryImageFolder = $storage->createFolder(self::FOLDER_CATEGORY_IMAGES); } } return $this->categoryImageFolder; }