/** * @param $id * @return \yii\web\Response * @throws NotFoundHttpException * @throws \Exception */ public function actionDelete($id) { /** @var OrderData $model */ $model = OrderData::findOne($id); if (!$model) { throw new NotFoundHttpException(); } $model->delete(); return $this->redirect(['list', 'node' => $model->order_id]); }
/** * @return \yii\db\ActiveQuery */ public function getOrderLines() { return $this->hasMany(OrderData::className(), ['order_id' => 'id']); }