Пример #1
0
 /**
  * @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]);
 }
Пример #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getOrderLines()
 {
     return $this->hasMany(OrderData::className(), ['order_id' => 'id']);
 }