1 | <?php |
||
23 | class ExportService |
||
24 | { |
||
25 | /** |
||
26 | * Repository with registrations for the events |
||
27 | * |
||
28 | * @var \DERHANSEN\SfEventMgt\Domain\Repository\RegistrationRepository |
||
29 | */ |
||
30 | protected $registrationRepository; |
||
31 | |||
32 | /** |
||
33 | * ResourceFactory |
||
34 | * |
||
35 | * @var \TYPO3\CMS\Core\Resource\ResourceFactory |
||
36 | */ |
||
37 | protected $resourceFactory = null; |
||
38 | |||
39 | /** |
||
40 | * DI for $registrationRepository |
||
41 | * |
||
42 | * @param RegistrationRepository $registrationRepository |
||
43 | */ |
||
44 | public function injectRegistrationRepository( |
||
49 | |||
50 | /** |
||
51 | * DI for $resourceFactory |
||
52 | * |
||
53 | 2 | * @param ResourceFactory $resourceFactory |
|
54 | */ |
||
55 | 2 | public function injectResourceFactory(\TYPO3\CMS\Core\Resource\ResourceFactory $resourceFactory) |
|
59 | 1 | ||
60 | 1 | /** |
|
61 | 1 | * Initiates the CSV downloads for registrations of the given event uid |
|
62 | 1 | * |
|
63 | 1 | * @param int $eventUid EventUid |
|
64 | 1 | * @param array $settings Settings |
|
65 | 1 | * @throws Exception RuntimeException |
|
66 | * @return void |
||
67 | */ |
||
68 | public function downloadRegistrationsCsv($eventUid, $settings = []) |
||
81 | 5 | ||
82 | 5 | /** |
|
83 | 5 | * Returns, if the user has read/write access permissions to the __temp__ folder |
|
84 | 5 | * |
|
85 | 5 | * @return bool |
|
86 | 5 | */ |
|
87 | 5 | public function hasWriteAccessToTempFolder() |
|
106 | 5 | ||
107 | /** |
||
108 | 5 | * Returns all Registrations for the given eventUid as a CSV string |
|
109 | 5 | * |
|
110 | * @param int $eventUid EventUid |
||
111 | * @param array $settings Settings |
||
112 | 5 | * @throws Exception RuntimeException |
|
113 | * @return string |
||
114 | */ |
||
115 | public function exportRegistrationsCsv($eventUid, $settings = []) |
||
144 | |||
145 | /** |
||
146 | * Prepends Byte Order Mark to exported registrations |
||
147 | * |
||
148 | * @param string $exportedRegistrations |
||
149 | * @param array $settings |
||
150 | * @return string |
||
151 | */ |
||
152 | protected function prependByteOrderMark($exportedRegistrations, $settings) |
||
160 | |||
161 | /** |
||
162 | * Returns the requested field from the given registration. If the field is a DateTime object, |
||
163 | * a formatted date string is returned |
||
164 | * |
||
165 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registration |
||
166 | * @param string $field |
||
167 | * @return string |
||
168 | */ |
||
169 | protected function getFieldValue($registration, $field) |
||
178 | } |
||
179 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.