1 | <?php |
||
16 | class MapBuilder implements MapBuilderInterface |
||
17 | { |
||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | private $from = self::REF_ARRAY; |
||
22 | |||
23 | /** |
||
24 | * @var MappingInterface[] |
||
25 | */ |
||
26 | private $mappings = []; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $to = self::REF_ARRAY; |
||
32 | |||
33 | 6 | public function from($from) |
|
37 | |||
38 | 6 | public function to($to) |
|
42 | |||
43 | 3 | public function add($toField, $fromField) |
|
52 | |||
53 | 4 | public function addMapping(MappingInterface $mapping) |
|
58 | |||
59 | 2 | public function addEmbedded($fromField, MapInterface $map) |
|
64 | |||
65 | 2 | public function addResolver($toField, ValueResolverInterface $resolver) |
|
70 | |||
71 | 4 | public function getMap() |
|
75 | |||
76 | /** |
||
77 | * @param string $field |
||
78 | * @return ReferenceInterface |
||
79 | */ |
||
80 | 3 | protected function resolveFromRef($field) |
|
84 | |||
85 | /** |
||
86 | * @param string $field |
||
87 | * @return ReferenceInterface |
||
88 | */ |
||
89 | 4 | protected function resolveToRef($field) |
|
93 | |||
94 | /** |
||
95 | * @param string $referenceType |
||
96 | * @return bool |
||
97 | */ |
||
98 | 8 | private function isValidReferenceType($referenceType) |
|
108 | |||
109 | /** |
||
110 | * @param string $refType |
||
111 | * @param string $field |
||
112 | * @return ReferenceInterface |
||
113 | */ |
||
114 | 4 | private function resolveFieldReference($refType, $field) |
|
125 | |||
126 | /** |
||
127 | * @param string $target |
||
128 | * @param string $reference |
||
129 | * @return $this |
||
130 | * @throws InvalidReferenceTypeException |
||
131 | */ |
||
132 | 8 | private function setReferenceType($target, $reference) |
|
144 | } |
||
145 |