* if (!$cache->viewdiscussion()) { * // Code to do stuff and produce cachable content * $cache->viewdiscussion = has_capability('mod/forum:viewdiscussion', $coursecontext); * } * $content = $cache->viewdiscussion; *