]> _ Git - fluidbook-toolbox.git/commitdiff
wip #6262 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 12 Sep 2023 10:14:15 +0000 (12:14 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 12 Sep 2023 10:14:15 +0000 (12:14 +0200)
app/Models/FluidbookHealthIssues.php

index bffc9faaf49da6cb3f2e6b169d678d2d6b2d9989..06e583ce263a6a56b1775054ef6b6b0f17b1411b 100644 (file)
@@ -25,6 +25,7 @@ class FluidbookHealthIssues extends ToolboxModel
         $this->addField('fluidbook', FluidbookID::class, __('Fluidbook'));
         $this->addField('type', Integer::class, __('Type'));
         $this->addField('data', Text::class, __('Détails'));
+        $this->addField('count', Integer::class, __('Nombre d\'occurences'));
     }
 
     public static function addIssue($fluidbookId, $type, $data = '')
@@ -32,9 +33,9 @@ class FluidbookHealthIssues extends ToolboxModel
 
         $issue = self::withoutGlobalScopes()->where('fluidbook', $fluidbookId)->where('type', $type)->where('data', $data)->first();
         if (!$issue) {
-            $issue = new self(['fluidbook' => $fluidbookId, 'type' => $type, 'data' => $data]);
+            $issue = new self(['fluidbook' => $fluidbookId, 'type' => $type, 'data' => $data, 'count' => 0]);
         }
-        $issue->updateTimestamps();
+        $issue->count++;
         $issue->save();
     }
 }