瀏覽代碼

deleteById return deleted dbo

develop
Robin Thoni 8 年之前
父節點
當前提交
79960ee73b
共有 1 個檔案被更改,包括 4 行新增6 行删除
  1. 4
    6
      src/Utils/Business/LuBusiness.php

+ 4
- 6
src/Utils/Business/LuBusiness.php 查看文件

@@ -69,15 +69,13 @@ abstract class LuBusiness {
69 69
 
70 70
     /**
71 71
      * @param $id int
72
-     * @return int
72
+     * @return LuDbo
73 73
      */
74 74
     public static function deleteById($id)
75 75
     {
76
-        $res = static::getDataAccess()->deleteSingleById($id);
77
-        if (!$res) {
78
-            self::notFound(static::getResourceName() . " not found");
79
-        }
80
-        return $res;
76
+        $dbo = static::getById($id);
77
+        static::getDataAccess()->deleteSingleById($id);
78
+        return $dbo;
81 79
     }
82 80
 
83 81
     /**

Loading…
取消
儲存