public function getBlogPostVersions(int $postId) : array { $posts = $this->db->run(\Airship\queryString('blog.posts.list_versions'), $postId); if (empty($posts)) { return []; } return $posts; }
/** * View the history for a blog post. * * @param string $postID * * @route blog/post/history/{id} */ public function postHistory(string $postID = '') { $blog = $this->blog->getBlogPostById((int) $postID); if (!$blog || !$this->can('read')) { \Airship\redirect($this->airship_cabin_prefix . '/blog/post'); } $this->lens('blog/post_history', ['active_link' => 'bridge-link-blog-posts', 'blog' => $blog, 'history' => $this->blog->getBlogPostVersions((int) $postID)]); }