Exemple #1
0
 public function getMemberCount()
 {
     $key = sprintf("group:member_count:%d", $this->id);
     $cnt = self::cacheGet($key);
     if (is_integer($cnt)) {
         return (int) $cnt;
     }
     $mem = new Group_member();
     $mem->group_id = $this->id;
     // XXX: why 'distinct'?
     $cnt = (int) $mem->count('distinct profile_id');
     self::cacheSet($key, $cnt);
     return $cnt;
 }