From 9098128585da0ca1ffc404573ad3eca63261e30b Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 7 Feb 2024 18:39:28 +0100 Subject: [PATCH] wait #6716 @1 --- src/app/Magic/Traits/CustomDataSource.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/Magic/Traits/CustomDataSource.php b/src/app/Magic/Traits/CustomDataSource.php index acfc619..6f6a13b 100644 --- a/src/app/Magic/Traits/CustomDataSource.php +++ b/src/app/Magic/Traits/CustomDataSource.php @@ -20,7 +20,7 @@ trait CustomDataSource /** * @return array[] */ - public static function getData($force=false) + public static function getData($force = false) { if ($force || static::$_data === null) { static::$_data = static::_getData(); @@ -36,13 +36,13 @@ trait CustomDataSource return []; } - public static function refreshDatabase($force=false) + public static function refreshDatabase($force = false) { $hadError = false; $instance = (new static); - $listAllInDb = static::all(); + $listAllInDb = static::withoutGlobalScopes()->get(); $pk = $instance->getPrimaryKey(); $existingKeys = []; foreach ($listAllInDb as $item) { @@ -69,7 +69,7 @@ trait CustomDataSource Log::error($e); } - static::whereIn($pk, $toDelete)->delete(); + static::whereIn($pk, $toDelete)->forceDelete(); Cache::put(static::getCacheKey() . '_refresh', $hadError ? -1 : time()); } -- 2.39.5