Browse Source

added id in editbyid

develop
Robin Thoni 8 years ago
parent
commit
c509cbfb7c
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      src/Utils/DataAccess/LuDataAccess.php

+ 6
- 3
src/Utils/DataAccess/LuDataAccess.php View File

218
     /**
218
     /**
219
      * @param $dbo LuDbo
219
      * @param $dbo LuDbo
220
      * @param string[] $ignoreList
220
      * @param string[] $ignoreList
221
+     * @param int $id
221
      * @return int
222
      * @return int
222
      */
223
      */
223
-    public static function editSingleById($dbo, $ignoreList = [])
224
+    public static function editSingleById($dbo, $ignoreList = [], $id = null)
224
     {
225
     {
225
         $json = static::prepareDbo($dbo, $ignoreList);
226
         $json = static::prepareDbo($dbo, $ignoreList);
226
-        $id = $json['id'];
227
-        unset($json['id']);
227
+        if (is_null($id)) {
228
+            $id = $json['id'];
229
+            unset($json['id']);
230
+        }
228
         return static::getTable()->where("id", "=", $id)->update($json);
231
         return static::getTable()->where("id", "=", $id)->update($json);
229
     }
232
     }
230
 
233
 

Loading…
Cancel
Save