Skip to content
Snippets Groups Projects
Verified Commit fbf3f934 authored by Damien's avatar Damien
Browse files

[REFACTORING] Static database reset

parent 121c6bfb
No related branches found
No related tags found
No related merge requests found
...@@ -46,9 +46,7 @@ foreach ($customs as $custom) { ...@@ -46,9 +46,7 @@ foreach ($customs as $custom) {
} }
} }
if (!empty($db)) { \SrcCore\models\DatabasePDO::reset();
$db->reset();
}
$db = new \SrcCore\models\DatabasePDO(['customId' => $custom]); $db = new \SrcCore\models\DatabasePDO(['customId' => $custom]);
foreach ($priorities as $key => $priority) { foreach ($priorities as $key => $priority) {
......
...@@ -15,9 +15,7 @@ foreach ($customs as $custom) { ...@@ -15,9 +15,7 @@ foreach ($customs as $custom) {
continue; continue;
} }
if (!empty($db)) { \SrcCore\models\DatabasePDO::reset();
$db->reset();
}
$db = new \SrcCore\models\DatabasePDO(['customId' => $custom]); $db = new \SrcCore\models\DatabasePDO(['customId' => $custom]);
......
...@@ -191,7 +191,7 @@ class DatabasePDO ...@@ -191,7 +191,7 @@ class DatabasePDO
return ['where' => $where, 'limit' => $limit]; return ['where' => $where, 'limit' => $limit];
} }
public function reset() public static function reset()
{ {
self::$pdo = null; self::$pdo = null;
self::$preparedQueries = []; self::$preparedQueries = [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment