Forwards ArrayAccess
to an EAV array property named $attributes
.
ArrayAccess
must be implemented by the class using this trait. The $attributes
property must also be defined in the class, and annotated with @eav <TABLE>
.
The instance must have its attributes loaded before use as an array, otherwise existing EAV data may be lost when the instance is saved. Attribute loading is done automatically by Record.
Protected Properties | |
array | $attributes |
Public Methods | |
scalar[] | getAttributes () |
bool | offsetExists ($attr) |
null scalar | offsetGet ($attr) |
void | offsetSet ($attr, $value) |
void | offsetUnset ($attr) |
$this | setAttributes (array $attributes) |
scalar [] getAttributes | ( | ) |
bool offsetExists | ( | $attr | ) |
mixed | $attr |
null scalar offsetGet | ( | $attr | ) |
mixed | $attr |
void offsetSet | ( | $attr, | |
$value | |||
) |
mixed | $attr | |
null | scalar | $value |
void offsetUnset | ( | $attr | ) |
mixed | $attr |
$this setAttributes | ( | array | $attributes | ) |
scalar[] | $attributes |