/** * get the cached number of profiles tagged with this * people tag, re-count if the argument is true. * * @param boolean $recount whether to ignore cache * * @return integer count */ function taggedCount($recount = false) { $keypart = sprintf('profile_list:tagged_count:%d:%s', $this->tagger, $this->tag); $count = self::cacheGet($keypart); if ($count === false) { $tags = new Profile_tag(); $tags->tag = $this->tag; $tags->tagger = $this->tagger; $count = $tags->count('distinct tagged'); self::cacheSet($keypart, $count); } return $count; }