PHP Interface Mongolid\Model\AttributesAccessInterface

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

Méthodes publiques

Méthode 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 méthode

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

fill() public méthode

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.
Résultat void

getAttribute() public méthode

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

getAttributes() public méthode

Get all attributes from the model.
public getAttributes ( ) : mixed
Résultat mixed

setAttribute() public méthode

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.
Résultat void

syncOriginalAttributes() public méthode

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