| 1 | <?php |
||
| 9 | abstract class AbstractCollectionArray extends AbstractConstCollectionArray implements |
||
| 10 | CollectionInterface, |
||
| 11 | IndexAccessInterface, |
||
| 12 | ConstIndexAccessInterface, |
||
| 13 | CollectionConvertableInterface, |
||
| 14 | \Serializable, |
||
| 15 | \JsonSerializable |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * {@inheritdoc} |
||
| 19 | */ |
||
| 20 | public function setAll($items) |
||
| 21 | { |
||
| 22 | if (!is_array($items) && !$items instanceof \Traversable) { |
||
| 23 | throw new \InvalidArgumentException('Parameter must be an array or an instance of Traversable'); |
||
| 24 | } |
||
| 25 | |||
| 26 | foreach ($items as $key => $item) { |
||
| 27 | if (is_array($item)) { |
||
| 28 | $item = new static($item); |
||
| 29 | } |
||
| 30 | $this->set($key, $item); |
||
| 31 | } |
||
| 32 | |||
| 33 | return $this; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * {@inheritdoc} |
||
| 38 | */ |
||
| 39 | 1 | public function clear() |
|
| 45 | } |
||
| 46 |