Flarum\Core\Post\DiscussionRenamedPost::saveAfter PHP Метод

saveAfter() публичный Метод

public saveAfter ( Post $previous = null )
$previous Flarum\Core\Post
    public function saveAfter(Post $previous = null)
    {
        // If the previous post is another 'discussion renamed' post, and it's
        // by the same user, then we can merge this post into it. If we find
        // that we've in fact reverted the title, delete it. Otherwise, update
        // its content.
        if ($previous instanceof static && $this->user_id === $previous->user_id) {
            if ($previous->content[0] == $this->content[1]) {
                $previous->delete();
            } else {
                $previous->content = static::buildContent($previous->content[0], $this->content[1]);
                $previous->save();
            }
            return $previous;
        }
        $this->save();
        return $this;
    }