summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/model_cache.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers/model_cache.php')
-rw-r--r--modules/gallery/helpers/model_cache.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gallery/helpers/model_cache.php b/modules/gallery/helpers/model_cache.php
index a3e09862..302e42d9 100644
--- a/modules/gallery/helpers/model_cache.php
+++ b/modules/gallery/helpers/model_cache.php
@@ -22,8 +22,8 @@ class model_cache_Core {
static function get($model_name, $id, $field_name="id") {
if (TEST_MODE || empty(self::$cache->$model_name->$field_name->$id)) {
- $model = ORM::factory($model_name)->where($field_name, $id)->find();
- if (!$model->loaded) {
+ $model = ORM::factory($model_name)->where($field_name, "=", $id)->find();
+ if (!$model->loaded()) {
throw new Exception("@todo MISSING_MODEL $model_name:$id");
}
self::$cache->$model_name->$field_name->$id = $model;