This documentation describes unreleased changes on the main branch.

PostPage

Class.

use Saij\WpAppFramework\Query\PostPage;

One page of the posts of a query (PostQuery::paginate()) with the number of all matching posts.

Methods

getPage()

getPage(): int

The page, starting with 1.

Returns int

getPageCount()

getPageCount(): int

The number of pages; 0 without matching posts.

Returns int

getPerPage()

getPerPage(): int

The number of posts per page, as passed to PostQuery::paginate().

Returns int

getPosts()

getPosts(): array

The posts of the page, in the order of the query; an empty list after the last page.

Returns list<T>

getTotal()

getTotal(): int

The number of matching posts on all pages.

Returns int