summaryrefslogtreecommitdiff
path: root/app/Core/Tool.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Core/Tool.php')
-rw-r--r--app/Core/Tool.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/Core/Tool.php b/app/Core/Tool.php
index 1a2e9904..85b684e2 100644
--- a/app/Core/Tool.php
+++ b/app/Core/Tool.php
@@ -34,8 +34,11 @@ class Tool
public static function loadModel(Registry $registry, $name)
{
- $class = '\Model\\'.ucfirst($name);
- $registry->$name = new $class($registry);
+ if (! isset($registry->$name)) {
+ $class = '\Model\\'.ucfirst($name);
+ $registry->$name = new $class($registry);
+ }
+
return $registry->shared($name);
}
}