1 | <?php |
||
13 | class FormDataMapper implements FormDataMapperInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | private $mapping; |
||
19 | |||
20 | /** |
||
21 | * Constructor |
||
22 | * |
||
23 | * @param array $mapping Field mapping |
||
24 | */ |
||
25 | 8 | public function __construct(array $mapping) |
|
29 | |||
30 | /** |
||
31 | * Convert request to form data |
||
32 | * |
||
33 | * @param string $request Request data |
||
34 | * @param string $className Document class |
||
35 | * @return array |
||
36 | */ |
||
37 | 8 | public function convertToFormData($request, $className) |
|
51 | |||
52 | /** |
||
53 | * Recursive mapper to rename fields for form |
||
54 | * |
||
55 | * @param mixed $item Item to map |
||
56 | * @param string $path Field path |
||
57 | * @param string $name rename field to ... |
||
58 | * @return array |
||
59 | */ |
||
60 | 3 | private function mapField($item, $path, $name) |
|
91 | } |
||
92 |