1 | <?php |
||
17 | abstract class AbstractCollectionMapper extends AbstractPropertyMapper implements CollectionMapper |
||
18 | { |
||
19 | /** @var Mapper */ |
||
20 | protected $nested; |
||
21 | /** @var AsCollection */ |
||
22 | protected $options; |
||
23 | |||
24 | /** |
||
25 | * AbstractCollectionMapper constructor. |
||
26 | * |
||
27 | * @param AsCollection $options |
||
28 | * @param Mapper $nested |
||
29 | */ |
||
30 | 119 | public function __construct(AsCollection $options, Mapper $nested) |
|
35 | |||
36 | /** |
||
37 | * @param $subject |
||
38 | * |
||
39 | * @return bool |
||
40 | */ |
||
41 | 107 | protected function isIterable($subject) |
|
45 | |||
46 | /** |
||
47 | * @param mixed $result |
||
48 | * |
||
49 | * @return mixed |
||
50 | */ |
||
51 | 60 | protected function createAwakeResult($result) |
|
62 | |||
63 | /** |
||
64 | * @return AsCollection |
||
65 | */ |
||
66 | 7 | public function getOptions() |
|
70 | |||
71 | /** |
||
72 | * @return Mapper |
||
73 | */ |
||
74 | 15 | public function getNested() |
|
78 | |||
79 | /** |
||
80 | * @param Mapper $nested |
||
81 | * |
||
82 | * @return $this |
||
83 | */ |
||
84 | 3 | public function setNested(Mapper $nested) |
|
90 | |||
91 | /** |
||
92 | * @param string $class |
||
93 | * |
||
94 | * @return bool |
||
95 | */ |
||
96 | 6 | public function isLeaveOfType($class) |
|
102 | |||
103 | /** |
||
104 | * @return Mapper |
||
105 | */ |
||
106 | 8 | public function getLeaf() |
|
116 | |||
117 | /** |
||
118 | * @param Mapper $leave |
||
119 | */ |
||
120 | 2 | public function setLeaf(Mapper $leave) |
|
130 | |||
131 | /** |
||
132 | * @return null|CollectionMapper |
||
133 | */ |
||
134 | 4 | public function getLeafParent() |
|
147 | |||
148 | /** |
||
149 | * @param string $collectionClass |
||
150 | * |
||
151 | * @return $this |
||
152 | */ |
||
153 | 3 | public function setLeafParentsCollectionType($collectionClass) |
|
167 | |||
168 | /** |
||
169 | * Get the nesting level. |
||
170 | * |
||
171 | * If there is no nested element the level is 0 (this can never be the case, as the constructor ensures the nested mapper). |
||
172 | * If there is a nested element the level is 1. |
||
173 | * If there is a nested element with a nested element as well the level 2. |
||
174 | * |
||
175 | * ... and so forth |
||
176 | * |
||
177 | * @return mixed |
||
178 | */ |
||
179 | 2 | public function getNestingLevel() |
|
191 | } |
||
192 |