1 | <?php |
||
17 | class MappingTransformer |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * @var PropertyAccessor |
||
22 | */ |
||
23 | protected $propertyAccessor; |
||
24 | |||
25 | /** |
||
26 | * Constructor |
||
27 | * |
||
28 | * @param PropertyAccessor $propertyAccessor The Symfony PropertyAccessor for reading / writing the objects / arrays |
||
29 | */ |
||
30 | public function __construct(PropertyAccessor $propertyAccessor) |
||
34 | |||
35 | /** |
||
36 | * Applies the given mapping on a given object or array. |
||
37 | * |
||
38 | * @param object|array $raw The input object or array |
||
39 | * @param array $mapping The mapping |
||
40 | * @param object|array $transformed The output object or array. |
||
41 | * @return array |
||
42 | */ |
||
43 | public function transform($raw, array $mapping, $transformed = []) |
||
52 | } |
||
53 |