numComments() public method

Count the number of posts. trinary: NULL -> all posts TRUE -> all published posts FALSE -> all unpublished posts
public numComments ( mixed $published = null ) : integer
$published mixed
return integer
Esempio n. 1
0
 /**
  * @route blog/comments{_page}
  * @param string $page
  */
 public function listComments($page = null)
 {
     if (!$this->can('publish')) {
         \Airship\redirect($this->airship_cabin_prefix . '/blog');
     }
     list($offset, $limit) = $this->getOffsetAndLimit($page);
     $this->lens('blog/comments', ['active_link' => 'bridge-link-blog-comments', 'comments' => $this->blog->listComments($offset, $limit), 'pagination' => ['base' => $this->airship_cabin_prefix . '/blog/post', 'suffix' => '/', 'count' => $this->blog->numComments(), 'page' => (int) \ceil($offset / ($limit ?? 1)) + 1, 'per_page' => $limit]]);
 }