|
@@ -218,13 +218,16 @@ abstract class LuDataAccess implements LuDatabaseProvider {
|
218
|
218
|
/**
|
219
|
219
|
* @param $dbo LuDbo
|
220
|
220
|
* @param string[] $ignoreList
|
|
221
|
+ * @param int $id
|
221
|
222
|
* @return int
|
222
|
223
|
*/
|
223
|
|
- public static function editSingleById($dbo, $ignoreList = [])
|
|
224
|
+ public static function editSingleById($dbo, $ignoreList = [], $id = null)
|
224
|
225
|
{
|
225
|
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
|
231
|
return static::getTable()->where("id", "=", $id)->update($json);
|
229
|
232
|
}
|
230
|
233
|
|