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 = []) |
|
90 | |||
91 | 5 | /** |
|
92 | 4 | * Returns all Registrations for the given eventUid as a CSV string |
|
93 | 4 | * |
|
94 | 4 | * @param int $eventUid EventUid |
|
95 | 4 | * @param array $settings Settings |
|
96 | * @throws Exception RuntimeException |
||
97 | * @return string |
||
98 | */ |
||
99 | public function exportRegistrationsCsv($eventUid, $settings = []) |
||
142 | |||
143 | /** |
||
144 | * Returns an array with fieldvalues for the given registration |
||
145 | * |
||
146 | * @param Registration $registration |
||
147 | * @param array $registrationFieldData |
||
148 | * @return array |
||
149 | */ |
||
150 | protected function getRegistrationFieldValues($registration, $registrationFieldData) |
||
168 | |||
169 | /** |
||
170 | * Returns an array of registration field uids and title |
||
171 | * |
||
172 | * @param int $eventUid |
||
173 | * @return array |
||
174 | */ |
||
175 | protected function getRegistrationFieldData($eventUid) |
||
186 | |||
187 | /** |
||
188 | * Prepends Byte Order Mark to exported registrations |
||
189 | * |
||
190 | * @param string $exportedRegistrations |
||
191 | * @param array $settings |
||
192 | * @return string |
||
193 | */ |
||
194 | protected function prependByteOrderMark($exportedRegistrations, $settings) |
||
202 | |||
203 | /** |
||
204 | * Returns the requested field from the given registration. If the field is a DateTime object, |
||
205 | * a formatted date string is returned |
||
206 | * |
||
207 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registration |
||
208 | * @param string $field |
||
209 | * @return string |
||
210 | */ |
||
211 | protected function getFieldValue($registration, $field) |
||
220 | |||
221 | /** |
||
222 | * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication |
||
223 | */ |
||
224 | protected function getBackendUser() |
||
228 | } |
||
229 |
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.