Skip to content

Latest commit

 

History

History
275 lines (135 loc) · 4.7 KB

Table.md

File metadata and controls

275 lines (135 loc) · 4.7 KB

Raudius\Luar\Interpreter\LuarObject\Table

This class represents the Lua table type inside the Luar interpreter.

Implements:

Raudius\Luar\Interpreter\LuarObject\LuarObject, JsonSerializable, Stringable

Extend:

Raudius\Luar\Interpreter\Scope

Methods

Name Description
__toString
fromArray Table instantiation from a PHP array.
getLength Returns the length of the table. This is the length as defined by Lua: https://www.lua.org/manual/5.3/manual.html#3.4.7
getMetaTable Returns the meta table for this table. If none, returns a nil literal LuaObject See: https://www.lua.org/manual/5.3/manual.html#pdf-getmetatable
getType
getValue
jsonSerialize Converts the table to a JSON-serializable array.
next Returns the value that comes after the specified key. If key is NULL, the first value is returned.
setMetaTable Sets the meta-table for this object.

Inherited methods

Name Description
__construct -
__debugInfo -
assign -
get -
getAssigns -
getExit -
getParent -
getReturn -
getScope -
has -
isRoot -
remove -
resetExit -
setExit -
setExpectedExit -

Table::__toString

Description

 __toString (void)

Parameters

This function has no parameters.

Return Values

void


Table::fromArray

Description

public static fromArray (array $array)

Table instantiation from a PHP array.

Parameters

  • (array) $array

Return Values

static


Table::getLength

Description

public getLength (void)

Returns the length of the table. This is the length as defined by Lua: https://www.lua.org/manual/5.3/manual.html#3.4.7

Parameters

This function has no parameters.

Return Values

int


Table::getMetaTable

Description

public getMetaTable (void)

Returns the meta table for this table. If none, returns a nil literal LuaObject See: https://www.lua.org/manual/5.3/manual.html#pdf-getmetatable

Parameters

This function has no parameters.

Return Values

\LuarObject


Table::getType

Description

 getType (void)

Parameters

This function has no parameters.

Return Values

void


Table::getValue

Description

 getValue (void)

Parameters

This function has no parameters.

Return Values

void


Table::jsonSerialize

Description

public jsonSerialize (void)

Converts the table to a JSON-serializable array.

Parameters

This function has no parameters.

Return Values

array


Table::next

Description

public next (void)

Returns the value that comes after the specified key. If key is NULL, the first value is returned.

Parameters

This function has no parameters.

Return Values

\LuarObject[]

[key, value]


Table::setMetaTable

Description

public setMetaTable (\Table|null $table)

Sets the meta-table for this object.

See Lua documentation for more information on meta-tables.
https://www.lua.org/manual/5.3/manual.html#pdf-setmetatable

Parameters

  • (\Table|null) $table

Return Values

void