Browse Source

refrator LuBusiness

develop
Robin Thoni 8 years ago
parent
commit
d2d821e5f6
1 changed files with 25 additions and 3 deletions
  1. 25
    3
      src/Utils/Business/LuBusiness.php

+ 25
- 3
src/Utils/Business/LuBusiness.php View File

58
      * @param $id int
58
      * @param $id int
59
      * @return LuDbo
59
      * @return LuDbo
60
      */
60
      */
61
-    public static function getById($id)
61
+    public static function getSingleById($id)
62
     {
62
     {
63
         $data = static::getDataAccess()->getSingleById($id);
63
         $data = static::getDataAccess()->getSingleById($id);
64
         if (is_null($data)) {
64
         if (is_null($data)) {
71
      * @param $id int
71
      * @param $id int
72
      * @return LuDbo
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
         static::getDataAccess()->deleteSingleById($id);
77
         static::getDataAccess()->deleteSingleById($id);
78
         return $dbo;
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
      * @return LuDataAccess
104
      * @return LuDataAccess
83
      */
105
      */

Loading…
Cancel
Save