]> _ Git - cubist_cms-back.git/commitdiff
wait #6716 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 7 Feb 2024 17:39:28 +0000 (18:39 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 7 Feb 2024 17:39:28 +0000 (18:39 +0100)
src/app/Magic/Traits/CustomDataSource.php

index acfc6196b6b7322661fdd32c6193733dde077f96..6f6a13bfef8b35f62e38c93e646ead6cb81053c9 100644 (file)
@@ -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());
     }