class Table implements Iterator, ArrayAccess, Countable (View source)

Constants

TYPE_INT

TYPE_STRING

TYPE_FLOAT

Properties

int $size
int $memorySize

Methods

__construct(int $table_size, float $conflict_proportion = 0.2)

No description

bool
column(string $name, int $type, int $size = 0)

No description

bool
create()

No description

bool
destroy()

No description

bool
set(string $key, array $value)

No description

array|false
stats()

No description

mixed
get(string $key, string $field = null)

No description

bool
del(string $key)

This method has an alias of \Swoole\Table::delete().

bool
delete(string $key)

Alias of method \Swoole\Table::del().

bool
exists(string $key)

This method has an alias of \Swoole\Table::exist().

bool
exist(string $key)

Alias of method \Swoole\Table::exists().

int
incr(string $key, string $column, mixed $incrby = 1)

No description

int
decr(string $key, string $column, mixed $decrby = 1)

No description

int
getSize()

No description

int
getMemorySize()

No description

mixed
current()

No description

mixed
key()

No description

void
next()

No description

void
rewind()

No description

bool
valid()

No description

bool
offsetExists(TKey $offset)

Whether or not an offset exists.

mixed
offsetGet(TKey $offset)

Returns the value at specified offset.

void
offsetSet(TKey $offset, TValue $value)

Assigns a value to the specified offset.

void
offsetUnset(TKey $offset)

Unsets an offset.

int
count()

No description

Details

__construct(int $table_size, float $conflict_proportion = 0.2)

No description

Parameters

int $table_size
float $conflict_proportion

bool column(string $name, int $type, int $size = 0)

No description

Parameters

string $name
int $type
int $size

Return Value

bool

bool create()

No description

Return Value

bool

bool destroy()

No description

Return Value

bool

returns TRUE all the time

bool set(string $key, array $value)

No description

Parameters

string $key
array $value

Return Value

bool

array|false stats()

Since: 4.8.0

No description

Return Value

array|false

Return an array of stats information; Return FALSE when error happens.

mixed get(string $key, string $field = null)

No description

Parameters

string $key
string $field

Return Value

mixed

bool del(string $key)

This method has an alias of \Swoole\Table::delete().

Parameters

string $key

Return Value

bool

See also

Table::delete

bool delete(string $key)

Alias of method \Swoole\Table::del().

Parameters

string $key

Return Value

bool

See also

Table::del

bool exists(string $key)

This method has an alias of \Swoole\Table::exist().

Parameters

string $key

Return Value

bool

See also

Table::exist

bool exist(string $key)

Alias of method \Swoole\Table::exists().

Parameters

string $key

Return Value

bool

See also

Table::exists

int incr(string $key, string $column, mixed $incrby = 1)

No description

Parameters

string $key
string $column
mixed $incrby

Return Value

int

int decr(string $key, string $column, mixed $decrby = 1)

No description

Parameters

string $key
string $column
mixed $decrby

Return Value

int

int getSize()

No description

Return Value

int

int getMemorySize()

No description

Return Value

int

mixed current()

No description

Return Value

mixed

Can return any type.

See also

Iterator::current
https://www.php.net/manual/en/iterator.current.php {@inheritDoc}

mixed key()

No description

Return Value

mixed

TKey on success, or null on failure.

See also

Iterator::key
https://www.php.net/manual/en/iterator.key.php {@inheritDoc}

void next()

No description

Return Value

void

Any returned value is ignored.

See also

Iterator::next
https://www.php.net/manual/en/iterator.next.php {@inheritDoc}

void rewind()

No description

Return Value

void

Any returned value is ignored.

See also

Iterator::rewind
https://www.php.net/manual/en/iterator.rewind.php {@inheritDoc}

bool valid()

No description

Return Value

bool

The return value will be casted to boolean and then evaluated. Returns true on success or false on failure.

See also

Iterator::valid
https://www.php.net/manual/en/iterator.valid.php {@inheritDoc}

bool offsetExists(TKey $offset)

Whether or not an offset exists.

Parameters

TKey $offset

An offset to check for.

Return Value

bool

true on success or false on failure.

The return value will be casted to boolean if non-boolean was returned.

See also

ArrayAccess::offsetExists
https://www.php.net/manual/en/arrayaccess.offsetexists.php {@inheritDoc}

mixed offsetGet(TKey $offset)

Returns the value at specified offset.

Parameters

TKey $offset

The offset to retrieve.

Return Value

mixed

Can return all value types.

See also

ArrayAccess::offsetGet
https://www.php.net/manual/en/arrayaccess.offsetget.php {@inheritDoc}

void offsetSet(TKey $offset, TValue $value)

Assigns a value to the specified offset.

Parameters

TKey $offset

The offset to assign the value to.

TValue $value

The value to set.

Return Value

void

See also

ArrayAccess::offsetSet
https://www.php.net/manual/en/arrayaccess.offsetset.php {@inheritDoc}

void offsetUnset(TKey $offset)

Unsets an offset.

Parameters

TKey $offset

The offset to unset.

Return Value

void

See also

ArrayAccess::offsetUnset
https://www.php.net/manual/en/arrayaccess.offsetunset.php {@inheritDoc}

int count()

No description

Return Value

int

The custom count as an integer.

The return value is cast to an integer.

See also

Countable::count
https://www.php.net/manual/en/countable.count.php {@inheritDoc}