checkHelp($id); $this->incrHelpViewCount($help); $this->eventsManager->fire('Help:afterView', $this, $help); return $this->handleHelp($help); } protected function handleHelp(HelpModel $help) { return [ 'id' => $help->id, 'title' => $help->title, 'keywords' => $help->keywords, 'content' => $help->content, 'published' => $help->published, 'deleted' => $help->deleted, 'view_count' => $help->view_count, 'create_time' => $help->create_time, 'update_time' => $help->update_time, ]; } protected function incrHelpViewCount(HelpModel $help) { $help->view_count += 1; $help->update(); } }