ArrayMemory implements Countable, Memory
FinalYes
Interfaces
- Countable
- Memory
Methods
- __construct() : mixed
- chunks() : array<string|int, self>
- count() : int
- dump() : array<string|int, array<string, mixed>>
- Example: [['id' => 1], ['id' => 2], ['id' => 3], ['id' => 4]].
- flatValues() : array<string|int, mixed>
- This method is a combination of array_map and array_values functions.
- map() : array<string|int, mixed>
- save() : void
Methods
__construct()
public
__construct([array<string|int, array<string, mixed>> $memory = [] ]) : mixed
Parameters
- $memory : array<string|int, array<string, mixed>> = []
Tags
chunks()
public
chunks(int $size) : array<string|int, self>
Parameters
- $size : int
Return values
array<string|int, self>count()
public
count() : int
Return values
intdump()
Example: [['id' => 1], ['id' => 2], ['id' => 3], ['id' => 4]].
public
dump() : array<string|int, array<string, mixed>>
Return values
array<string|int, array<string, mixed>>flatValues()
This method is a combination of array_map and array_values functions.
public
flatValues() : array<string|int, mixed>
Turns: [['id' => 1], ['id' => 2], ['id' => 3], ['id' => 4]] Into: [1, 2, 3, 4]
Return values
array<string|int, mixed>map()
public
map(callable(array<string, mixed>): mixed $callback) : array<string|int, mixed>
Parameters
- $callback : callable(array<string, mixed>): mixed
Return values
array<string|int, mixed>save()
public
save(array<string|int, array<string, mixed>> $data) : void
Parameters
- $data : array<string|int, array<string, mixed>>