| @@ 142-154 (lines=13) @@ | ||
| 139 | * |
|
| 140 | * @return ModelCollectionInterface |
|
| 141 | */ |
|
| 142 | public function setModels(array $models): ModelCollectionInterface |
|
| 143 | { |
|
| 144 | $this->resolveModels(); |
|
| 145 | ||
| 146 | foreach ($this->models as $model) { |
|
| 147 | $this->removeModel($model); |
|
| 148 | } |
|
| 149 | foreach ($models as $model) { |
|
| 150 | $this->addModel($model); |
|
| 151 | } |
|
| 152 | ||
| 153 | return $this; |
|
| 154 | } |
|
| 155 | ||
| 156 | /** |
|
| 157 | * @return ModelInterface[]|array |
|
| @@ 102-112 (lines=11) @@ | ||
| 99 | * |
|
| 100 | * @return ModelCollectionInterface |
|
| 101 | */ |
|
| 102 | public function setModels(array $models): ModelCollectionInterface |
|
| 103 | { |
|
| 104 | foreach ($this->models as $model) { |
|
| 105 | $this->removeModel($model); |
|
| 106 | } |
|
| 107 | foreach ($models as $model) { |
|
| 108 | $this->addModel($model); |
|
| 109 | } |
|
| 110 | ||
| 111 | return $this; |
|
| 112 | } |
|
| 113 | ||
| 114 | /** |
|
| 115 | * @return ModelInterface[]|array |
|