class Cursor implements Arrayable (View source)

Properties

protected array $parameters

The parameters associated with the cursor.

protected bool $pointsToNextItems

Determine whether the cursor points to the next or previous set of items.

Methods

__construct(array $parameters, bool $pointsToNextItems = true)

Create a new cursor instance.

string|null
parameter(string $parameterName)

Get the given parameter from the cursor.

array
parameters(array $parameterNames)

Get the given parameters from the cursor.

bool
pointsToNextItems()

Determine whether the cursor points to the next set of items.

bool
pointsToPreviousItems()

Determine whether the cursor points to the previous set of items.

toArray()

Get the array representation of the cursor.

string
encode()

Get the encoded string representation of the cursor to construct a URL.

static Cursor|null
fromEncoded(string|null $encodedString)

Get a cursor instance from the encoded string representation.

Details

__construct(array $parameters, bool $pointsToNextItems = true)

Create a new cursor instance.

Parameters

array $parameters
bool $pointsToNextItems

string|null parameter(string $parameterName)

Get the given parameter from the cursor.

Parameters

string $parameterName

Return Value

string|null

Exceptions

UnexpectedValueException

array parameters(array $parameterNames)

Get the given parameters from the cursor.

Parameters

array $parameterNames

Return Value

array

bool pointsToNextItems()

Determine whether the cursor points to the next set of items.

Return Value

bool

bool pointsToPreviousItems()

Determine whether the cursor points to the previous set of items.

Return Value

bool

toArray()

Get the array representation of the cursor.

string encode()

Get the encoded string representation of the cursor to construct a URL.

Return Value

string

static Cursor|null fromEncoded(string|null $encodedString)

Get a cursor instance from the encoded string representation.

Parameters

string|null $encodedString

Return Value

Cursor|null