浏览代码

refrator LuBusiness

develop
Robin Thoni 8 年前
父节点
当前提交
d2d821e5f6
共有 1 个文件被更改,包括 25 次插入3 次删除
  1. 25
    3
      src/Utils/Business/LuBusiness.php

+ 25
- 3
src/Utils/Business/LuBusiness.php 查看文件

@@ -58,7 +58,7 @@ abstract class LuBusiness {
58 58
      * @param $id int
59 59
      * @return LuDbo
60 60
      */
61
-    public static function getById($id)
61
+    public static function getSingleById($id)
62 62
     {
63 63
         $data = static::getDataAccess()->getSingleById($id);
64 64
         if (is_null($data)) {
@@ -71,13 +71,35 @@ abstract class LuBusiness {
71 71
      * @param $id int
72 72
      * @return LuDbo
73 73
      */
74
-    public static function deleteById($id)
74
+    public static function deleteSingleById($id)
75 75
     {
76
-        $dbo = static::getById($id);
76
+        $dbo = static::getSingleById($id);
77 77
         static::getDataAccess()->deleteSingleById($id);
78 78
         return $dbo;
79 79
     }
80 80
 
81
+    /**
82
+     * @param $dbo LuDbo
83
+     * @return LuDbo
84
+     */
85
+    public static function addSingleId($dbo)
86
+    {
87
+        $id = static::getDataAccess()->addSingleId($dbo);
88
+        return static::getSingleById($id);
89
+    }
90
+
91
+    /**
92
+     * @param $id int
93
+     * @param $dbo LuDbo
94
+     * @return LuDbo
95
+     */
96
+    public static function editSingleById($id, $dbo)
97
+    {
98
+        static::getSingleById($id);
99
+        static::getDataAccess()->editSingleById($dbo, $id);
100
+        return static::getSingleById($id);
101
+    }
102
+
81 103
     /**
82 104
      * @return LuDataAccess
83 105
      */

正在加载...
取消
保存