@@ 165-172 (lines=8) @@ | ||
162 | * |
|
163 | * @return array |
|
164 | */ |
|
165 | public function actionAssign(string $id) |
|
166 | { |
|
167 | $items = Yii::$app->getRequest()->post('items', []); |
|
168 | $model = $this->findModel($id); |
|
169 | $model->addChildren($items); |
|
170 | ||
171 | return array_merge($model->getItems()); |
|
172 | } |
|
173 | ||
174 | /** |
|
175 | * Remove items |
|
@@ 181-188 (lines=8) @@ | ||
178 | * |
|
179 | * @return array |
|
180 | */ |
|
181 | public function actionRemove(string $id): array |
|
182 | { |
|
183 | $items = Yii::$app->getRequest()->post('items', []); |
|
184 | $model = $this->findModel($id); |
|
185 | $model->removeChildren($items); |
|
186 | ||
187 | return array_merge($model->getItems()); |
|
188 | } |
|
189 | ||
190 | /** |
|
191 | * @inheritdoc |