class AttributeBag extends Collection implements AttributeBag

Methods

__construct(array $attributes = array())

Create new AttributeBag.

$this
set(Attribute|string $key, mixed $value = null)

Add or update attribute.

add(Attribute $attribute)

Set attribute.

mixed
getValue(string $key)

Get attribute value.

$this
forget(string $key)

Unset attribute.

void
offsetSet(string $key, mixed $value)

Set attribute.

void
offsetUnset(string $key)

Set attribute to null.

__set(string $key, mixed $value)

Handle dynamic properties.

mixed
__get(string $key)

Handle dynamic properties.

boolean
__isset(string $key)

Handle isset calls.

void
__unset(string $key)

Handle unset calls.

replicate($except = null)

Create copy of the attribute bag.

Details

at line 14
__construct(array $attributes = array())

Create new AttributeBag.

Parameters

array $attributes

at line 29
$this set(Attribute|string $key, mixed $value = null)

Add or update attribute.

Parameters

Attribute|string $key
mixed $value

Return Value

$this

at line 65
add(Attribute $attribute)

Set attribute.

Parameters

Attribute $attribute

at line 117
mixed getValue(string $key)

Get attribute value.

Parameters

string $key

Return Value

mixed

at line 130
$this forget(string $key)

Unset attribute.

Parameters

string $key

Return Value

$this

at line 146
void offsetSet(string $key, mixed $value)

Set attribute.

Parameters

string $key
mixed $value

Return Value

void

at line 157
void offsetUnset(string $key)

Set attribute to null.

Parameters

string $key

Return Value

void

at line 168
__set(string $key, mixed $value)

Handle dynamic properties.

Parameters

string $key
mixed $value

at line 179
mixed __get(string $key)

Handle dynamic properties.

Parameters

string $key

Return Value

mixed

at line 190
boolean __isset(string $key)

Handle isset calls.

Parameters

string $key

Return Value

boolean

at line 201
void __unset(string $key)

Handle unset calls.

Parameters

string $key

Return Value

void

at line 234
AttributeBag replicate($except = null)

Create copy of the attribute bag.

Parameters

$except

Return Value

AttributeBag