W3cubDocs

/Symfony 3.0

Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface

interface AttributeBagInterface implements SessionBagInterface

Attributes store.

Methods

string getName()

Gets this bag's name.

from SessionBagInterface
initialize(array $array)

Initializes the Bag.

from SessionBagInterface
string getStorageKey()

Gets the storage key for this bag.

from SessionBagInterface
mixed clear()

Clears out data from bag.

from SessionBagInterface
bool has(string $name)

Checks if an attribute is defined.

mixed get(string $name, mixed $default = null)

Returns an attribute.

set(string $name, mixed $value)

Sets an attribute.

array all()

Returns attributes.

replace(array $attributes)

Sets attributes.

mixed remove(string $name)

Removes an attribute.

Details

public string getName()

Gets this bag's name.

Return Value

string

public initialize(array $array)

Initializes the Bag.

Parameters

array $array

public string getStorageKey()

Gets the storage key for this bag.

Return Value

string

public mixed clear()

Clears out data from bag.

Return Value

mixed Whatever data was contained.

public bool has(string $name)

Checks if an attribute is defined.

Parameters

string $name The attribute name

Return Value

bool true if the attribute is defined, false otherwise

public mixed get(string $name, mixed $default = null)

Returns an attribute.

Parameters

string $name The attribute name
mixed $default The default value if not found

Return Value

mixed

public set(string $name, mixed $value)

Sets an attribute.

Parameters

string $name
mixed $value

public array all()

Returns attributes.

Return Value

array Attributes

public replace(array $attributes)

Sets attributes.

Parameters

array $attributes Attributes

public mixed remove(string $name)

Removes an attribute.

Parameters

string $name

Return Value

mixed The removed value or null when it does not exist