A data object that supports registering properties and importing/exporting from array and JSON.
IvoPetkov\DataObject implements ArrayAccess {
/* Methods */
public __construct ( [ array $data = [] ] )
protected self defineProperty ( string $name [, array $options = [] ] )
public static object fromArray ( array $data )
public static object fromJSON ( string $data )
public array toArray ( [ array $options = [] ] )
public string toJSON ( [ array $options = [] ] )
}
public __construct ( [ array $data = [] ] )
Constructs a new data object.
protected self defineProperty ( string $name [, array $options = [] ] )
Defines a new property. Use closures with $this->privateProperty instead of local variables in the constructor (thay cannot be cloned).
public static object fromArray ( array $data )
Creates an object and fills its properties from the array specified.
public static object fromJSON ( string $data )
Creates an object and fills its properties from the JSON specified.
public array toArray ( [ array $options = [] ] )
Returns the object data converted as an array.
public string toJSON ( [ array $options = [] ] )
Returns the object data converted as JSON.
Location: ~/src/DataObject.php