PHP Interface Mongolid\Model\AttributesAccessInterface

It is supposed to be used in conjunction with Attributes trait
See also: Attributes
Datei anzeigen Open project: leroy-merlin-br/mongolid

Public Methods

Method Description
cleanAttribute ( string $key ) : void Set a given attribute on the model.
fill ( array $input, boolean $force = false ) : void Set the model attributes using an array.
getAttribute ( string $key ) : mixed Get an attribute from the model.
getAttributes ( ) : mixed Get all attributes from the model.
setAttribute ( string $key, mixed $value ) : void Set a given attribute on the model.
syncOriginalAttributes ( ) : void Stores original attributes from actual data from attributes to be used in future comparisons about changes.

Method Details

cleanAttribute() public method

Set a given attribute on the model.
public cleanAttribute ( string $key ) : void
$key string Name of the attribute to be unset.
return void

fill() public method

Set the model attributes using an array.
public fill ( array $input, boolean $force = false ) : void
$input array The data that will be used to fill the attributes.
$force boolean Force fill.
return void

getAttribute() public method

Get an attribute from the model.
public getAttribute ( string $key ) : mixed
$key string The attribute to be accessed.
return mixed

getAttributes() public method

Get all attributes from the model.
public getAttributes ( ) : mixed
return mixed

setAttribute() public method

Set a given attribute on the model.
public setAttribute ( string $key, mixed $value ) : void
$key string Name of the attribute to be set.
$value mixed Value to be set.
return void

syncOriginalAttributes() public method

Ideally should be called once right after retrieving data from the database.
public syncOriginalAttributes ( ) : void
return void