Page implements Arrayable, IteratorAggregate, ArrayAccess, JsonSerializable
FinalYes
Table of Contents
Interfaces
- Arrayable
- IteratorAggregate
- ArrayAccess
- JsonSerializable
Methods
- __construct() : mixed
- getId() : string
- getItems() : array<string|int, mixed>
- getIterator() : Traversable
- Retrieve an external iterator
- getTotalCount() : int
- jsonSerialize() : mixed
- Specify data which should be serialized to JSON
- offsetExists() : bool
- Whether a offset exists
- offsetGet() : mixed
- Offset to retrieve
- offsetSet() : void
- Offset to set
- offsetUnset() : void
- Offset to unset
- toArray() : array<string|int, mixed>
Methods
__construct()
public
__construct(string $id, array<string|int, mixed>|Traversable $items, int|Closure $totalCount) : mixed
Parameters
- $id : string
-
Id of collection.
- $items : array<string|int, mixed>|Traversable
- $totalCount : int|Closure
-
The parameter can be Closure to prevent unnecessary actions for calculation.
getId()
public
getId() : string
Return values
stringgetItems()
public
getItems() : array<string|int, mixed>
Return values
array<string|int, mixed>getIterator()
Retrieve an external iterator
public
getIterator() : Traversable
Tags
Return values
Traversable —An instance of an object implementing Iterator or Traversable
getTotalCount()
public
getTotalCount() : int
Return values
intjsonSerialize()
Specify data which should be serialized to JSON
public
jsonSerialize() : mixed
Tags
Return values
mixed —data which can be serialized by json_encode, which is a value of any type other than a resource.
offsetExists()
Whether a offset exists
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
-
An offset to check for.
Tags
Return values
bool —true on success or false on failure.
The return value will be casted to boolean if non-boolean was returned.
offsetGet()
Offset to retrieve
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
-
The offset to retrieve.
Tags
Attributes
- #[ReturnTypeWillChange]
Return values
mixed —Can return all value types.
offsetSet()
Offset to set
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
-
The offset to assign the value to.
- $value : mixed
-
The value to set.
Tags
offsetUnset()
Offset to unset
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
-
The offset to unset.
Tags
toArray()
public
toArray() : array<string|int, mixed>