X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FConversation.php;h=e029c20ba0d095145cff147b35aaec6f49d5dd5b;hb=5c963cb3b704e5fdb82c218c2ddfc2c076e4fe68;hp=f540004ef39b6f9de2c7299ad80fbcd492626aff;hpb=cd29d3d646379aa9a1352035973c8e379cc7f42b;p=quix0rs-gnu-social.git diff --git a/classes/Conversation.php b/classes/Conversation.php index f540004ef3..e029c20ba0 100755 --- a/classes/Conversation.php +++ b/classes/Conversation.php @@ -75,5 +75,22 @@ class Conversation extends Memcached_DataObject return $conv; } -} + static function noticeCount($id) + { + $keypart = sprintf('conversation:notice_count:%d', $id); + + $cnt = self::cacheGet($keypart); + + if ($cnt !== false) { + return $cnt; + } + $notice = new Notice(); + $notice->conversation = $id; + $cnt = $notice->count(); + + self::cacheSet($keypart, $cnt); + + return $cnt; + } +}