HasAttributesTrait
trait HasAttributesTrait (View source)
Represent an object which has an array of attributes.
Methods
mixed
getAttribute(string $attribute, mixed $default = '')
Get attribute.
array
getAttributes()
Get all attributes.
void
setAttribute(string $attribute, mixed $value)
Set attribute.
attribute(string $attribute, mixed $value)
Fluent alias for setAttribute().
void
setAttributes(array $attributes)
Set all attributes.
attributes(array $attributes)
Fluent alias for setAttributes().
Details
at line 32
mixed
getAttribute(string $attribute, mixed $default = '')
Get attribute.
at line 41
array
getAttributes()
Get all attributes.
at line 52
void
setAttribute(string $attribute, mixed $value)
Set attribute.
at line 67
HasAttributesTrait
attribute(string $attribute, mixed $value)
Fluent alias for setAttribute().
at line 80
void
setAttributes(array $attributes)
Set all attributes.
No attempt to merge attributes is done - this is a direct overwrite operation.
at line 91
HasAttributesTrait
attributes(array $attributes)
Fluent alias for setAttributes().