1 | <?php |
||
21 | class AttachmentService |
||
22 | { |
||
23 | /** |
||
24 | * Returns an array of filenames to attach to notifications |
||
25 | * |
||
26 | * Attachments must be configured as following (example for "registrationNew"): |
||
27 | * |
||
28 | * registrationNew { |
||
29 | * attachments { |
||
30 | * user { |
||
31 | * fromFiles { |
||
32 | * 1 = fileadmin/path-to-attachment.pdf |
||
33 | * } |
||
34 | * fromEventProperty { |
||
35 | * 1 = files |
||
36 | * 2 = image |
||
37 | * } |
||
38 | * fromRegistrationProperty { |
||
39 | * 1 = propertyOfRegistration |
||
40 | * } |
||
41 | * } |
||
42 | * admin { |
||
43 | * fromFiles = |
||
44 | * fromEventProperty = |
||
45 | * fromRegistrationProperty = |
||
46 | * } |
||
47 | * } |
||
48 | * } |
||
49 | * |
||
50 | * @param array $settings |
||
51 | * @param Registration $registration |
||
52 | * @param int $messageType |
||
53 | * @param string $messageRecipient |
||
54 | * |
||
55 | * @return array Array with absolute filenames to attachments |
||
56 | */ |
||
57 | public function getAttachments($settings, $registration, $messageType, $messageRecipient) |
||
93 | |||
94 | 7 | /** |
|
95 | 7 | * Returns configured fromFiles attachments from TypoScript settings |
|
96 | 7 | * |
|
97 | 8 | * @param array $settings |
|
98 | * @return array |
||
99 | */ |
||
100 | protected function getFileAttachments($settings) |
||
111 | 5 | ||
112 | 5 | /** |
|
113 | 5 | * Returns the attachments from an object of all configured properties |
|
114 | 7 | * |
|
115 | * @param array $propertyNames |
||
116 | * @param AbstractEntity $object |
||
117 | * @return array |
||
118 | */ |
||
119 | protected function getObjectAttachments($propertyNames, $object) |
||
132 | 2 | ||
133 | 2 | /** |
|
134 | 7 | * Returns an array wih the absolute path to all FAL files in the given object-property |
|
135 | * |
||
136 | * @param AbstractEntity $object |
||
137 | * @param string $propertyName |
||
138 | * @return array |
||
139 | */ |
||
140 | protected function getAttachmentsFromProperty($object, $propertyName) |
||
161 | } |
||
162 |