コード例 #1
0
ファイル: Resources.php プロジェクト: kintastish/mobil
 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;
 }
コード例 #2
0
ファイル: ParamController.php プロジェクト: kintastish/mobil
 public function actionRemove($id)
 {
     Yii::$app->response->format = Response::FORMAT_JSON;
     if (($model = ResourceParam::findOne($id)) !== null) {
         $model->delete();
         return ['id' => $id];
     }
     return [];
 }