public function actionDeleteProduct($id)
    {
        if (($model = OrderProduct::findOne($id)) !== null) {
            $model->delete();
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }

        return $this->redirect(\Yii::$app->request->referrer);
    }
public function actionDeleteProduct($id)
    {
        if (($model = OrderProduct::findOne($id)) !== null) {
            $model->delete();
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }

        return $this->redirect(\Yii::$app->request->referrer);
    }
public function actionDeleteProduct ( $ id ) { if ( ( $ model = OrderProduct :: findOne ( $ id ) ) !== null ) { $ model -> delete ( ) ; } else { throw new NotFoundHttpException ( 'The requested page does not exist.' ) ; } return $ this -> redirect ( \ Yii :: $ app -> request -> referrer ) ; }
Deletes product from existing Order model.
If deletion is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed
@throws NotFoundHttpException
Deletes product from existing Order model . If deletion is successful the browser will be redirected to the view page .