Public Member Functions
|__set ($attributeName, $value)|
|save ($runValidation=true, array $attributeNames=null)|
Static Public Member Functions
|$originalAttributeValues = array()|
A CustomField owned by a SecurableItem in the sense that it is included in a relation with RedBeanModel::OWNED - its lifetime is controlled by the owning model. SecurableItems are secured and auditable and so the related models that they own are secured and auditable.
Sets the members and relations of the model as if they were actual attributes of the model. For example, if Account extends RedBeanModel and its attributeNames() returns that one it has a member 'name' and a relation 'owner' they are simply accessed as:
$account = new Account(); $account->name = 'International Corp'; $account->owner = User::getByUsername('bill'); $account->save();
|$attributeName||A non-empty string that is the name of a member or relation of the model.|
|$value||A value or model of the type specified as valid for the member or relation by the meta data supplied by the extending class's getMetadata() method.|
Reimplemented from BaseCustomField.
|save||(||$|| runValidation =
|array $|| attributeNames = |
Saves the model to the database. Models are only saved if they have been modified and related models are saved before this model. If a related model is modified and needs saving the deems the model to be modified and need saving, which ensures that keys are updated. Cyclic relationships are prevented from causing problems by the save only proceeding to non-saved models.
Reimplemented from RedBeanModel.