Visman 2 лет назад
Родитель
Сommit
a9b4eddd5f
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      app/Models/Report/Save.php

+ 4 - 2
app/Models/Report/Save.php

@@ -16,6 +16,8 @@ use RuntimeException;
 
 
 class Save extends Action
 class Save extends Action
 {
 {
+    const CACHE_KEY = 'report';
+
     /**
     /**
      * Обновляет репорт в БД
      * Обновляет репорт в БД
      */
      */
@@ -99,8 +101,8 @@ class Save extends Action
         $report->id = (int) $this->c->DB->lastInsertId();
         $report->id = (int) $this->c->DB->lastInsertId();
         $report->resModified();
         $report->resModified();
 
 
-        if (true !== $this->c->Cache->set('report', $report->id)) {
-            throw new RuntimeException('Unable to write value to cache - report');
+        if (true !== $this->c->Cache->set(self::CACHE_KEY, $report->id)) {
+            throw new RuntimeException('Unable to write value to cache - ' . self::CACHE_KEY);
         }
         }
 
 
         return $report->id;
         return $report->id;