function clearGroupInboxes() { $gi = new Group_inbox(); $gi->notice_id = $this->id; if ($gi->find()) { while ($gi->fetch()) { self::blow('user_group:notice_ids:%d', $gi->group_id); $gi->delete(); } } $gi->free(); }
function blowGroupCache($blowLast = false) { $cache = common_memcache(); if ($cache) { $group_inbox = new Group_inbox(); $group_inbox->notice_id = $this->id; if ($group_inbox->find()) { while ($group_inbox->fetch()) { $cache->delete(common_cache_key('group:notices:' . $group_inbox->group_id)); if ($blowLast) { $cache->delete(common_cache_key('group:notices:' . $group_inbox->group_id . ';last')); } $member = new Group_member(); $member->group_id = $group_inbox->group_id; if ($member->find()) { while ($member->fetch()) { $cache->delete(common_cache_key('user:notices_with_friends:' . $member->profile_id)); if ($blowLast) { $cache->delete(common_cache_key('user:notices_with_friends:' . $member->profile_id . ';last')); } } } } } $group_inbox->free(); unset($group_inbox); } }