diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-05-14 01:19:05 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-05-14 01:19:05 +0000 |
commit | f439fe96c81930d0b7d43c02a3108fd15c17715e (patch) | |
tree | 3e7531df4c50d08ae318070fe9c553bd66ffbf22 /core/helpers | |
parent | 96d59caa3b32b58b10147f059047d13d57f24968 (diff) |
Overload ORM_Iterator to cache models as we pull them out of the
result set. This allows us to see the cache and avoid further
lookups.
Diffstat (limited to 'core/helpers')
-rw-r--r-- | core/helpers/model_cache.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/helpers/model_cache.php b/core/helpers/model_cache.php index d8158902..f4b11a6e 100644 --- a/core/helpers/model_cache.php +++ b/core/helpers/model_cache.php @@ -31,4 +31,10 @@ class model_cache_Core { return self::$cache->$model_name->$field_name->$id; } + + static function set($model) { + self::$cache->{$model->object_name} + ->{$model->primary_key} + ->{$model->{$model->primary_key}} = $model; + } } |