|
Prismic.io PHP kit
3.0.0
|
Public Member Functions | |
| __construct ($results, $page, $resultsPerPage, $resultsSize, $totalResultsSize, $totalPages, $nextPage, $prevPage) | |
| getResults () | |
| getPage () | |
| getResultsPerPage () | |
| getResultsSize () | |
| getTotalResultsSize () | |
| getTotalPages () | |
| getNextPage () | |
| getPrevPage () | |
Static Public Member Functions | |
| static | parse (\stdClass $json) |
This class embodies a search request response from the prismic.io API, containing a list of documents, as well as meta-information about this list (mostly about pagination).
This is what is returned when you call submit() on a search request, which is the only kind of request except for the API endpoint. So, let's say that when you call prismic.io's API, you get that object a lot.
Do remember that requests in prismic.io are paginated by 20 by default.
| Prismic\Response::__construct | ( | $results, | |
| $page, | |||
| $resultsPerPage, | |||
| $resultsSize, | |||
| $totalResultsSize, | |||
| $totalPages, | |||
| $nextPage, | |||
| $prevPage | |||
| ) |
Constructs a Response object.
| array | $results | the list of returned documents |
| int | $page | the page number for this query |
| int | $resultsPerPage | the requested number of results per page on this query |
| int | $resultsSize | the size of the current page |
| int | $totalResultsSize | the total number of documents, all pages together |
| int | $totalPages | the number of pages for this query |
| string | $nextPage | the RESTful URL of the search request for the next page; null otherwise |
| string | $prevPage | the RESTful URL of the search request for the previous page; null otherwise |
| Prismic\Response::getNextPage | ( | ) |
Returns the RESTful URL of the search request for the next page; null otherwise.
| Prismic\Response::getPage | ( | ) |
Returns the page number for this query.
| Prismic\Response::getPrevPage | ( | ) |
Returns the RESTful URL of the search request for the previous page; null otherwise.
| Prismic\Response::getResults | ( | ) |
Returns the list of returned documents, which is an array of Document objects.
| Prismic\Response::getResultsPerPage | ( | ) |
Returns the requested number of results per page on this query.
| Prismic\Response::getResultsSize | ( | ) |
Returns the size of the current page.
| Prismic\Response::getTotalPages | ( | ) |
Returns the number of pages for this query.
| Prismic\Response::getTotalResultsSize | ( | ) |
Returns the total number of documents, all pages together.
|
static |
Parsing a Responses from a json, unmarshalling them into PHP objects.
| $json | the JSON retrieved from the call |
1.8.12