class Table

Relay Table is a persistent per-worker hash table that can store arbitrary data.

Methods

__construct(int $serializer = \Relay\Relay::SERIALIZER_PHP)

Create a table instance.

mixed
get(string $key)

Get a key from the table.

mixed
getField(string $key, string $field)

Get a field of a cached key. This is an array lookup.

bool
set(string $key, mixed $value)

Set a key in the table.

bool
exists(string $key)

Check if a key exists in the table.

bool
delete(string $key)

Remove a key from the table.

bool
clear()

Removes all keys from the table.

int
count()

Get the number of keys stored in the table.

Details

at line 3611
__construct(int $serializer = \Relay\Relay::SERIALIZER_PHP)

Create a table instance.

Parameters

int $serializer

at line 3620
mixed get(string $key)

Get a key from the table.

Will return null if key doesn't exist.

Parameters

string $key

Return Value

mixed

at line 3629
mixed getField(string $key, string $field)

Get a field of a cached key. This is an array lookup.

Parameters

string $key
string $field

Return Value

mixed

at line 3638
bool set(string $key, mixed $value)

Set a key in the table.

Parameters

string $key
mixed $value ;

Return Value

bool

at line 3646
bool exists(string $key)

Check if a key exists in the table.

Parameters

string $key

Return Value

bool

at line 3654
bool delete(string $key)

Remove a key from the table.

Parameters

string $key

Return Value

bool

at line 3661
bool clear()

Removes all keys from the table.

Return Value

bool

at line 3668
int count()

Get the number of keys stored in the table.

Return Value

int