\Copilot\ClientPage

A page object to define page sizes and the like.

For all API calls that return multiple elements co*pilot returns a page. A page contains 0 to n elements and some information about the page that can be used for pagination. Whenever a call is made with a page object, the page object will be populated with the information for that call.

Example: $page = new Page(30, 1); $client->getAgencyArtists($page);

The page will now contain the information about how much artists are available at all ($totalElements), how the elements are sorted ($sort) and how many pages can be retrieved with that page size. To load the next page you would simply call:

$client->getAgenyArtists(new Page(30, 2));

which in turn will return the next 30 artists from page 2.

Summary

Methods
Properties
Constants
__construct()
$size
$number
$sort
$direction
$totalElements
$totalPages
$last
$first
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$size

$size : integer

The maximum amount of elements on that page

Type

integer — The pages maximum size

$number

$number : integer

The page number you want to access

Type

integer — The page number

$sort

$sort : string

The property after which the elements are sorted

Type

string — The property to sort after

$direction

$direction : string

The direction you want to sort

Type

string — Either asc or desc

$totalElements

$totalElements : integer

The number of total elements for the current API call

Type

integer — The maximum number of elements to be returned for the API call

$totalPages

$totalPages : integer

The amount of pages for the current page size

Type

integer — The maximum amount of pages

$last

$last : boolean

States if this is the last page

Type

boolean — True, if this is the last page

$first

$first : boolean

States if this is the first page

Type

boolean — True, if this is the first page

Methods

__construct()

__construct(integer  $size, integer  $number) 

Constructs a new page object with the given size and page number

Parameters

integer $size

The size of the page

integer $number

The page number