diff options
| author | Nathan Kinkade <nkinkade@nkinka.de> | 2010-12-23 02:12:38 +0000 |
|---|---|---|
| committer | Nathan Kinkade <nkinkade@nkinka.de> | 2010-12-23 02:12:38 +0000 |
| commit | 5e17a5e7fcb678bd7081bdf8089afec5b25f3aff (patch) | |
| tree | 9590eae390af1f72b72ddc6500a2566e3558e3bb /modules/user/models/group.php | |
| parent | cf1965957c48b1c88a3913f8167688d03d191cec (diff) | |
| parent | 032e6fde5f99c3150a4ae70e410ce314d8c3877a (diff) | |
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/user/models/group.php')
| -rw-r--r-- | modules/user/models/group.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/user/models/group.php b/modules/user/models/group.php index 17d9320b..8f8e218d 100644 --- a/modules/user/models/group.php +++ b/modules/user/models/group.php @@ -19,6 +19,7 @@ */ class Group_Model_Core extends ORM implements Group_Definition { protected $has_and_belongs_to_many = array("users"); + protected $users_cache = null; /** * @see ORM::delete() @@ -28,10 +29,14 @@ class Group_Model_Core extends ORM implements Group_Definition { module::event("group_before_delete", $this); parent::delete($id); module::event("group_deleted", $old); + $this->users_cache = null; } public function users() { - return $this->users->find_all(); + if (!$this->users_cache) { + $this->users_cache = $this->users->find_all()->as_array(); + } + return $this->users_cache; } /** @@ -60,6 +65,7 @@ class Group_Model_Core extends ORM implements Group_Definition { module::event("group_updated", $original, $this); } + $this->users_cache = null; return $this; } |
