class Table

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

Methods

__construct(string|null $namespace = null, int $serializer = Relay::SERIALIZER_PHP)

Create a Relay table instance.

mixed
get(string $key)

Returns a key, or null if key doesn't exist.

mixed
pluck(string $key, string $field)

Pluck a key from a cached key.

bool
set(string $key, mixed $value)

Set a key and its value.

bool
exists(string $key)

Check if a key exists in the table.

bool
delete(string $key)

Remove a key from the table.

int
count()

The number of keys stored in the table.

string|null
namespace()

Get the table's namespace.

static array
namespaces()

Returns all table namespaces.

bool
clear()

Removes all keys from the table.

static int
clearAll()

Removes all keys from all tables.

Details

at line 4835
__construct(string|null $namespace = null, int $serializer = Relay::SERIALIZER_PHP)

Create a Relay table instance.

Parameters

string|null $namespace
int $serializer

at line 4843
mixed get(string $key)

Returns a key, or null if key doesn't exist.

Parameters

string $key

Return Value

mixed

at line 4852
mixed pluck(string $key, string $field)

Pluck a key from a cached key.

Parameters

string $key
string $field

Return Value

mixed

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

Set a key and its value.

Parameters

string $key
mixed $value

Return Value

bool

at line 4869
bool exists(string $key)

Check if a key exists in the table.

Parameters

string $key

Return Value

bool

at line 4877
bool delete(string $key)

Remove a key from the table.

Parameters

string $key

Return Value

bool

at line 4884
int count()

The number of keys stored in the table.

Return Value

int

at line 4891
string|null namespace()

Get the table's namespace.

Return Value

string|null

at line 4898
static array namespaces()

Returns all table namespaces.

Return Value

array

at line 4905
bool clear()

Removes all keys from the table.

Return Value

bool

at line 4912
static int clearAll()

Removes all keys from all tables.

Return Value

int