/** * @return \yii\db\ActiveQuery */ public function getParams() { return $this->hasMany(Param::className(), ['product_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getParam() { return $this->hasOne(Param::className(), ['id' => 'param_id']); }
/** * Deletes param from product model. * * Users which have 'updateOwnProduct' permission can delete params only for Product models that have been created by their. * Users which have 'updateProduct' permission can delete params for all Product models. * * @param integer $id * @return mixed * @throws ForbiddenHttpException */ public function actionDeleteParam($id) { $param = Param::findOne($id); $param->delete(); return $this->redirect(Yii::$app->request->referrer); }