public function getParamValue($id) { $p = ResourceParam::find()->where(['table_id' => self::$tableId, 'item_id' => $this->id, 'type_id' => $id])->one(); if ($p !== null) { return $p->value; } return null; }
public function actionRemove($id) { Yii::$app->response->format = Response::FORMAT_JSON; if (($model = ResourceParam::findOne($id)) !== null) { $model->delete(); return ['id' => $id]; } return []; }