| @@ 399-416 (lines=18) @@ | ||
| 396 | ); |
|
| 397 | } |
|
| 398 | ||
| 399 | public function actionDeleteProperty($id, $property_group_id) |
|
| 400 | { |
|
| 401 | /** @var Property $model */ |
|
| 402 | $model = Property::findOne($id); |
|
| 403 | if (is_null($model)) { |
|
| 404 | throw new NotFoundHttpException; |
|
| 405 | } |
|
| 406 | $model->delete(); |
|
| 407 | Yii::$app->session->setFlash('danger', Yii::t('app', 'Object removed')); |
|
| 408 | return $this->redirect( |
|
| 409 | Url::to( |
|
| 410 | [ |
|
| 411 | '/backend/properties/group', |
|
| 412 | 'id'=>$property_group_id, |
|
| 413 | ] |
|
| 414 | ) |
|
| 415 | ); |
|
| 416 | } |
|
| 417 | ||
| 418 | public function actionRemoveAllProperties($group_id) |
|
| 419 | { |
|
| @@ 430-446 (lines=17) @@ | ||
| 427 | return $this->redirect(['group', 'id' => $group_id]); |
|
| 428 | } |
|
| 429 | ||
| 430 | public function actionDeleteGroup($id) |
|
| 431 | { |
|
| 432 | /** @var PropertyGroup $model */ |
|
| 433 | $model = PropertyGroup::findOne($id); |
|
| 434 | if (is_null($model)) { |
|
| 435 | throw new NotFoundHttpException; |
|
| 436 | } |
|
| 437 | $model->delete(); |
|
| 438 | Yii::$app->session->setFlash('danger', Yii::t('app', 'Object removed')); |
|
| 439 | return $this->redirect( |
|
| 440 | Url::to( |
|
| 441 | [ |
|
| 442 | '/backend/properties/index', |
|
| 443 | ] |
|
| 444 | ) |
|
| 445 | ); |
|
| 446 | } |
|
| 447 | ||
| 448 | public function actionRemoveAllGroups() |
|
| 449 | { |
|