| 1 | <?php |
||
| 7 | class ModelCollection implements ModelCollectionInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var ModelInterface[]|array |
||
| 11 | */ |
||
| 12 | private $models = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @return ModelInterface |
||
| 16 | */ |
||
| 17 | public function current() |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @return ModelInterface|false |
||
| 24 | */ |
||
| 25 | public function next() |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @return string |
||
| 32 | */ |
||
| 33 | public function key() |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @return bool |
||
| 40 | */ |
||
| 41 | public function valid() |
||
| 45 | |||
| 46 | public function rewind() |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @param ModelInterface $model |
||
| 53 | * @return ModelCollectionInterface |
||
| 54 | */ |
||
| 55 | public function add(ModelInterface $model): ModelCollectionInterface |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @param ModelInterface $model |
||
| 64 | * @return ModelCollectionInterface |
||
| 65 | */ |
||
| 66 | public function remove(ModelInterface $model): ModelCollectionInterface |
||
| 74 | |||
| 75 | /** |
||
| 76 | * @return ModelInterface[]|array |
||
| 77 | */ |
||
| 78 | public function toPersist(): array |
||
| 82 | |||
| 83 | /** |
||
| 84 | * @return ModelInterface[]|array |
||
| 85 | */ |
||
| 86 | public function toRemove(): array |
||
| 90 | |||
| 91 | /** |
||
| 92 | * @return array |
||
| 93 | */ |
||
| 94 | public function jsonSerialize(): array |
||
| 103 | } |
||
| 104 |