Browse Source

Change the return type from the lastInsertId() method

Visman 4 years ago
parent
commit
17a55c4aa1

+ 1 - 1
app/Models/Categories/Manager.php

@@ -95,7 +95,7 @@ class Manager extends ManagerModel
             VALUES (?s:name, ?i:position)';
 
         $this->c->DB->exec($query, $vars);
-        $cid = $this->c->DB->lastInsertId();
+        $cid = (int) $this->c->DB->lastInsertId();
         parent::set($cid, ['cat_name' => $name, 'disp_position' => $pos]);
 
         return $cid;

+ 1 - 1
app/Models/Forum/Save.php

@@ -102,7 +102,7 @@ class Save extends Action
             VALUES (' . \implode(', ', $set2) . ')';
 
         $this->c->DB->exec($query, $vars);
-        $forum->id = $this->c->DB->lastInsertId();
+        $forum->id = (int) $this->c->DB->lastInsertId();
         $forum->resModified();
 
         return $forum->id;

+ 1 - 1
app/Models/Group/Save.php

@@ -86,7 +86,7 @@ class Save extends Action
             VALUES ({$set2})";
 
         $this->c->DB->exec($query, $vars);
-        $group->g_id = $this->c->DB->lastInsertId();
+        $group->g_id = (int) $this->c->DB->lastInsertId();
         $group->resModified();
 
         return $group->g_id;

+ 1 - 1
app/Models/Post/Save.php

@@ -86,7 +86,7 @@ class Save extends Action
             VALUES ({$set2})";
 
         $this->c->DB->exec($query, $vars);
-        $post->id = $this->c->DB->lastInsertId();
+        $post->id = (int) $this->c->DB->lastInsertId();
         $post->resModified();
 
         return $post->id;

+ 1 - 1
app/Models/Report/Save.php

@@ -89,7 +89,7 @@ class Save extends Action
             VALUES ({$set2})";
 
         $this->c->DB->exec($query, $vars);
-        $report->id = $this->c->DB->lastInsertId();
+        $report->id = (int) $this->c->DB->lastInsertId();
         $report->resModified();
 
         $this->c->Cache->set('report', $report->id);

+ 1 - 1
app/Models/Topic/Save.php

@@ -86,7 +86,7 @@ class Save extends Action
             VALUES ({$set2})";
 
         $this->c->DB->exec($query, $vars);
-        $topic->id = $this->c->DB->lastInsertId();
+        $topic->id = (int) $this->c->DB->lastInsertId();
         $topic->resModified();
 
         return $topic->id;

+ 1 - 1
app/Models/User/Save.php

@@ -113,7 +113,7 @@ class Save extends Action
             VALUES ({$set2})";
 
         $this->c->DB->exec($query, $vars);
-        $user->id = $this->c->DB->lastInsertId();
+        $user->id = (int) $this->c->DB->lastInsertId();
         $user->resModified();
 
         if ($user->isAdmin) {