numPosts() public méthode

Count the number of posts. trinary: NULL -> all posts TRUE -> all published posts FALSE -> all unpublished posts
public numPosts ( mixed $published = null ) : integer
$published mixed
Résultat integer
Exemple #1
0
 /**
  * List the blog posts
  *
  * @route blog/post{_page}
  * @param string $page
  */
 public function listPosts($page = null)
 {
     list($offset, $limit) = $this->getOffsetAndLimit($page);
     $this->lens('blog/posts', ['active_link' => 'bridge-link-blog-posts', 'blog_posts' => $this->blog->listPosts($this->isSuperUser(), $offset, $limit), 'pagination' => ['base' => $this->airship_cabin_prefix . '/blog/post', 'suffix' => '/', 'count' => $this->blog->numPosts(), 'page' => (int) \ceil($offset / ($limit ?? 1)) + 1, 'per_page' => $limit]]);
 }