class SourceImageCollection implements Countable (View source)

Represents a collection of source images.

Methods

__construct(array $sourceImages, int $total, array $links = [], null $cursor = null)

Constructor.

int
count()

Return number in the collection.

int
getTotal()

Returns the total amount of items available in the API for the current listing.

string
getCursor()

Returns the cursor value, if any.

array
getLinks()

Returns the pagination/navigation links.

getSourceImages()

Return the source images in the collection.

createFromJsonResponse(string $jsonString)

Create a collection from the JSON data returned by the rokka.io API.

Details

__construct(array $sourceImages, int $total, array $links = [], null $cursor = null)

Constructor.

Parameters

array $sourceImages

Array of source images

int $total

The total amount of results matched

array $links

The navigation/browse links

null $cursor

The navigation cursor

int count()

Return number in the collection.

Return Value

int

int getTotal()

Returns the total amount of items available in the API for the current listing.

Return Value

int

string getCursor()

Returns the cursor value, if any.

Return Value

string

Returns the pagination/navigation links.

Return Value

array

SourceImage[] getSourceImages()

Return the source images in the collection.

Return Value

SourceImage[]

static SourceImageCollection createFromJsonResponse(string $jsonString)

Create a collection from the JSON data returned by the rokka.io API.

Parameters

string $jsonString

JSON as a string

Return Value

SourceImageCollection