1 | <?php |
||
27 | class ExportService |
||
28 | { |
||
29 | /** |
||
30 | * Repository with registrations for the events |
||
31 | * |
||
32 | * @var \DERHANSEN\SfEventMgt\Domain\Repository\RegistrationRepository |
||
33 | */ |
||
34 | protected $registrationRepository; |
||
35 | |||
36 | /** |
||
37 | * ResourceFactory |
||
38 | * |
||
39 | * @var \TYPO3\CMS\Core\Resource\ResourceFactory |
||
40 | */ |
||
41 | protected $resourceFactory = null; |
||
42 | |||
43 | /** |
||
44 | * DI for $registrationRepository |
||
45 | * |
||
46 | * @param RegistrationRepository $registrationRepository |
||
47 | */ |
||
48 | public function injectRegistrationRepository( |
||
53 | 2 | ||
54 | /** |
||
55 | 2 | * DI for $resourceFactory |
|
56 | 2 | * |
|
57 | 1 | * @param ResourceFactory $resourceFactory |
|
58 | */ |
||
59 | 1 | public function injectResourceFactory(\TYPO3\CMS\Core\Resource\ResourceFactory $resourceFactory) |
|
63 | 1 | ||
64 | 1 | /** |
|
65 | 1 | * Initiates the CSV downloads for registrations of the given event uid |
|
66 | * |
||
67 | * @param int $eventUid EventUid |
||
68 | * @param array $settings Settings |
||
69 | * @throws Exception RuntimeException |
||
70 | * @return void |
||
71 | */ |
||
72 | public function downloadRegistrationsCsv($eventUid, $settings = []) |
||
85 | 5 | ||
86 | 5 | /** |
|
87 | 5 | * Returns all Registrations for the given eventUid as a CSV string |
|
88 | 1 | * |
|
89 | 1 | * @param int $eventUid EventUid |
|
90 | * @param array $settings Settings |
||
91 | 5 | * @throws Exception RuntimeException |
|
92 | 4 | * @return string |
|
93 | 4 | */ |
|
94 | 4 | public function exportRegistrationsCsv($eventUid, $settings = []) |
|
121 | |||
122 | /** |
||
123 | * Prepends Byte Order Mark to exported registrations |
||
124 | * |
||
125 | * @param string $exportedRegistrations |
||
126 | * @param array $settings |
||
127 | * @return string |
||
128 | */ |
||
129 | protected function prependByteOrderMark($exportedRegistrations, $settings) |
||
136 | |||
137 | /** |
||
138 | * Returns the requested field from the given registration. If the field is a DateTime object, |
||
139 | * a formatted date string is returned |
||
140 | * |
||
141 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registration |
||
142 | * @param string $field |
||
143 | * @return string |
||
144 | */ |
||
145 | protected function getFieldValue($registration, $field) |
||
153 | } |
||
154 |
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.