A mutable model is a model whose source attributes can be changed.
An instance of a mutable model provides setters for any property.
This means you can call e.g. $model->setFoo($val)
which will will store the value at the index foo
in the internal source array.
You can also override the whole source at once with the MutableModel::setSource().
package |
NextEvent\PHPSDK\Model |
---|
__call(string $name, array $args) : mixed
If the source of your model contains, e.g. a property named 'my_property',
you can call getMyProperty()
to retrieve it's value.
string
array
mixed
__construct(array $source)
Parse source data.
Throws |
|
---|
array
The source data as received from the API
get(string $var) : mixed
Should be used, if you expect the model to have custom properties which are not known/covered by the known getters
string
mixed
isValid() : boolean
boolean
serialize() : string
Implements Serializable interface
string
setSource(array $source) : \NextEvent\PHPSDK\Model\MutableModel
access |
private |
---|
array
The source data as received from the API.
\NextEvent\PHPSDK\Model\MutableModel
toArray() : array
array
toLogContext() : array
Implements the LogContextInterface interface
array
toString() : string
string
unserialize( $serialized)
Implements Serializable interface