Interface

TRex\Core\IObject

interface IObject implements IDynamicObject, IArrayCastable, IJsonCastable

Base object.

Can be dynamic. Can be converted.

Methods

bool isDynamic()

Indicates whether the current object has dynamic properties access.

from IDynamicObject
setDynamic(bool $isDynamic)

Sets dynamic properties access.

from IDynamicObject
addMethod(string $name, Closure $method)

Adds a dynamic method to the object.

from IDynamicObject
array toArray()

Converts an object to an array.

from IArrayCastable
Json toJson(int $options = JSON_PRETTY_PRINT)

Converts an object to a Json object.

from IJsonCastable

Details

in IDynamicObject at line 17
public bool isDynamic()

Indicates whether the current object has dynamic properties access.

Return Value

bool

in IDynamicObject at line 24
public setDynamic(bool $isDynamic)

Sets dynamic properties access.

Parameters

bool $isDynamic

in IDynamicObject at line 32
public addMethod(string $name, Closure $method)

Adds a dynamic method to the object.

Parameters

string $name
Closure $method

in IArrayCastable at line 19
public array toArray()

Converts an object to an array.

The exported array contains all property values of the class and its parents, which are not transient.

Return Value

array

in IJsonCastable at line 21
public Json toJson(int $options = JSON_PRETTY_PRINT)

Converts an object to a Json object.

The exported data contains all property values ofn the class and its parents, who are not transient.

Parameters

int $options

Return Value

Json