Documentation

CRM_Utils_LazyArray
in package
implements ArrayAccess, IteratorAggregate, Countable

A lazy-array works much like a regular array or ArrayObject. However, it is initially empty - and it is only populated if used.

Table of Contents

Interfaces

ArrayAccess
IteratorAggregate
Countable

Properties

$cache  : array<string|int, mixed>|null
Cached values
$func  : callable
A function which generates a list of values.

Methods

__construct()  : mixed
CRM_Utils_LazyList constructor.
count()  : int
getArrayCopy()  : array<string|int, mixed>
getIterator()  : mixed
isLoaded()  : bool
Determine if the content has been fetched.
load()  : mixed
offsetExists()  : bool
offsetGet()  : mixed
offsetSet()  : void
offsetUnset()  : void

Properties

$cache

Cached values

private array<string|int, mixed>|null $cache

$func

A function which generates a list of values.

private callable $func

function(): iterable

Methods

__construct()

CRM_Utils_LazyList constructor.

public __construct(callable $func) : mixed
Parameters
$func : callable

Function which provides a list of values (array/iterator/generator).

count()

public count() : int
Return values
int

getArrayCopy()

public getArrayCopy() : array<string|int, mixed>
Return values
array<string|int, mixed>

getIterator()

public getIterator() : mixed
Attributes
#[ReturnTypeWillChange]

isLoaded()

Determine if the content has been fetched.

public isLoaded() : bool
Return values
bool

load()

public load([mixed $force = FALSE ]) : mixed
Parameters
$force : mixed = FALSE

offsetExists()

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

public & offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed
Attributes
#[ReturnTypeWillChange]

offsetSet()

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed

offsetUnset()

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

        
On this page

Search results