summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-01-20 09:10:49 +0000
committerBharat Mediratta <bharat@menalto.com>2009-01-20 09:10:49 +0000
commit37f9845c436917579bd36d0d6bc42914ee18e277 (patch)
treee84663de44dc377ab0296b5fefb09e60885047b8 /core
parent0536debdf176f3b3a50a620e4dd1debb6dcabbc0 (diff)
Revert r19765 -- the installer works fine with it the way it is.
Diffstat (limited to 'core')
-rw-r--r--core/helpers/model_cache.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/helpers/model_cache.php b/core/helpers/model_cache.php
index e508ff16..0fea8b75 100644
--- a/core/helpers/model_cache.php
+++ b/core/helpers/model_cache.php
@@ -18,17 +18,17 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class model_cache_Core {
- private static $cache = array();
+ private static $cache;
static function get($model_name, $id, $field_name="id") {
- if (TEST_MODE || empty(self::$cache[$model_name][$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) {
throw new Exception("@todo MISSING_MODEL $model_name:$id");
}
- self::$cache[$model_name][$field_name][$id] = $model;
-
+ self::$cache->$model_name->$field_name->$id = $model;
}
- return self::$cache[$model_name][$field_name][$id];
+
+ return self::$cache->$model_name->$field_name->$id;
}
}