App\Models\Forum\Forum::setLastPostCache PHP Method

setLastPostCache() public method

public setLastPostCache ( )
    public function setLastPostCache()
    {
        $lastTopic = $this->lastTopic(false);
        if ($lastTopic === null) {
            $this->forum_last_post_id = null;
            $this->forum_last_post_time = null;
            $this->forum_last_post_subject = null;
            $this->forum_last_poster_id = null;
            $this->forum_last_poster_name = null;
            $this->forum_last_poster_colour = null;
        } else {
            $this->forum_last_post_id = $lastTopic->topic_last_post_id;
            $this->forum_last_post_time = $lastTopic->topic_last_post_time;
            $this->forum_last_post_subject = $lastTopic->topic_title;
            $this->forum_last_poster_id = $lastTopic->topic_last_poster_id;
            $this->forum_last_poster_name = $lastTopic->topic_last_poster_name;
            $this->forum_last_poster_colour = $lastTopic->topic_last_poster_colour;
        }
    }