FluxBB\Actions\NewTopic::run PHP Метод

run() защищенный Метод

Run the action and return a response for the user.
protected run ( ) : array
Результат array
    protected function run()
    {
        $slug = $this->get('slug');
        $category = $this->categories->findBySlug($slug);
        $creator = User::current();
        $now = Carbon::now();
        $conversation = (object) ['poster' => $creator->username, 'title' => $this->get('subject'), 'posted' => $now, 'last_post' => $now, 'last_poster' => $creator->username, 'category_slug' => $category->slug];
        $post = new Post(['poster' => $creator->username, 'poster_id' => $creator->id, 'message' => $this->get('message'), 'posted' => $now]);
        $this->categories->addNewTopic($category, $conversation, $post->toArray());
        $this->raise(new UserHasPosted($creator, $post));
    }