1 | <?php |
||
24 | class ExportService |
||
25 | { |
||
26 | /** |
||
27 | * @var \DERHANSEN\SfEventMgt\Domain\Repository\RegistrationRepository |
||
28 | */ |
||
29 | protected $registrationRepository = null; |
||
30 | |||
31 | /** |
||
32 | * @var \DERHANSEN\SfEventMgt\Domain\Repository\EventRepository |
||
33 | */ |
||
34 | protected $eventRepository = null; |
||
35 | |||
36 | /** |
||
37 | * ResourceFactory |
||
38 | * |
||
39 | * @var \TYPO3\CMS\Core\Resource\ResourceFactory |
||
40 | */ |
||
41 | protected $resourceFactory = null; |
||
42 | |||
43 | /** |
||
44 | * @param RegistrationRepository $registrationRepository |
||
45 | */ |
||
46 | public function injectRegistrationRepository( |
||
51 | |||
52 | /** |
||
53 | 2 | * @param \DERHANSEN\SfEventMgt\Domain\Repository\EventRepository $eventRepository |
|
54 | */ |
||
55 | 2 | public function injectEventRepository(\DERHANSEN\SfEventMgt\Domain\Repository\EventRepository $eventRepository) |
|
59 | 1 | ||
60 | 1 | /** |
|
61 | 1 | * @param ResourceFactory $resourceFactory |
|
62 | 1 | */ |
|
63 | 1 | public function injectResourceFactory(\TYPO3\CMS\Core\Resource\ResourceFactory $resourceFactory) |
|
67 | |||
68 | /** |
||
69 | * Initiates the CSV downloads for registrations of the given event uid |
||
70 | * |
||
71 | * @param int $eventUid EventUid |
||
72 | * @param array $settings Settings |
||
73 | * @throws Exception RuntimeException |
||
74 | * @return void |
||
75 | */ |
||
76 | 5 | public function downloadRegistrationsCsv($eventUid, $settings = []) |
|
89 | 1 | ||
90 | /** |
||
91 | 5 | * Returns, if the user has read/write access permissions to the __temp__ folder |
|
92 | 4 | * |
|
93 | 4 | * @return bool |
|
94 | 4 | */ |
|
95 | 4 | public function hasWriteAccessToTempFolder() |
|
115 | |||
116 | /** |
||
117 | * Returns all Registrations for the given eventUid as a CSV string |
||
118 | * |
||
119 | * @param int $eventUid EventUid |
||
120 | * @param array $settings Settings |
||
121 | * @throws Exception RuntimeException |
||
122 | * @return string |
||
123 | */ |
||
124 | public function exportRegistrationsCsv($eventUid, $settings = []) |
||
167 | |||
168 | /** |
||
169 | * Returns an array with fieldvalues for the given registration |
||
170 | * |
||
171 | * @param Registration $registration |
||
172 | * @param array $registrationFieldData |
||
173 | * @return array |
||
174 | */ |
||
175 | protected function getRegistrationFieldValues($registration, $registrationFieldData) |
||
192 | |||
193 | /** |
||
194 | * Returns an array of registration field uids and title |
||
195 | * |
||
196 | * @param int $eventUid |
||
197 | * @return array |
||
198 | */ |
||
199 | protected function getRegistrationFieldData($eventUid) |
||
209 | |||
210 | /** |
||
211 | * Prepends Byte Order Mark to exported registrations |
||
212 | * |
||
213 | * @param string $exportedRegistrations |
||
214 | * @param array $settings |
||
215 | * @return string |
||
216 | */ |
||
217 | protected function prependByteOrderMark($exportedRegistrations, $settings) |
||
225 | |||
226 | /** |
||
227 | * Returns the requested field from the given registration. If the field is a DateTime object, |
||
228 | * a formatted date string is returned |
||
229 | * |
||
230 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registration |
||
231 | * @param string $field |
||
232 | * @return string |
||
233 | */ |
||
234 | protected function getFieldValue($registration, $field) |
||
243 | } |
||
244 |
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.