| 1 | <?php |
||
| 22 | class MultiCollection extends AbstractCollection |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * {@inheritdoc} |
||
| 26 | */ |
||
| 27 | public function contains($value, $index = null) |
||
| 28 | { |
||
| 29 | if (parent::contains($value, $index)) { |
||
| 30 | return true; |
||
| 31 | } |
||
| 32 | foreach ($this->data as $key => $arr) { |
||
| 33 | if (is_traversable($arr)) { |
||
| 34 | $coll = static::factory($arr); |
||
| 35 | if ($coll->contains($value, $index)) { |
||
| 36 | return true; |
||
| 37 | } |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | return false; |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * {@inheritdoc} |
||
| 46 | */ |
||
| 47 | protected function prepareData($data) |
||
| 48 | { |
||
| 49 | return $data; |
||
| 50 | } |
||
| 51 | |||
| 52 | protected function isConsistentDataStructure($data) |
||
| 56 | } |
||
| 57 |