From: Vincent Vanwaelscappel Date: Wed, 7 Feb 2024 17:39:28 +0000 (+0100) Subject: wait #6716 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9098128585da0ca1ffc404573ad3eca63261e30b;p=cubist_cms-back.git wait #6716 @1 --- 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()); }