| @@ 196-205 (lines=10) @@ | ||
| 193 | * |
|
| 194 | * @return \yii\web\Response |
|
| 195 | */ |
|
| 196 | public function actionUnlink($id, $flowId) |
|
| 197 | { |
|
| 198 | $model = $this->findModel($id); |
|
| 199 | ||
| 200 | if ($model->getFlows()->where(['id' => $flowId])->exists() && ($flow = Flow::findOne($flowId)) !== null) { |
|
| 201 | $model->unlink('flows', $flow, true); |
|
| 202 | } |
|
| 203 | ||
| 204 | return $this->redirect(['view', 'id' => $id]); |
|
| 205 | } |
|
| 206 | ||
| 207 | /** |
|
| 208 | * Finds the Screen model based on its primary key value. |
|
| @@ 152-161 (lines=10) @@ | ||
| 149 | * |
|
| 150 | * @return \yii\web\Response |
|
| 151 | */ |
|
| 152 | public function actionUnlink($id, $screenId) |
|
| 153 | { |
|
| 154 | $model = $this->findModel($id); |
|
| 155 | ||
| 156 | if ($model->getScreens()->where(['id' => $screenId])->exists() && ($screen = Screen::findOne($screenId)) !== null) { |
|
| 157 | $model->unlink('screens', $screen, true); |
|
| 158 | } |
|
| 159 | ||
| 160 | return $this->redirect(['view', 'id' => $id]); |
|
| 161 | } |
|
| 162 | ||
| 163 | /** |
|
| 164 | * Enables or disables a Device. |
|