class AutoExpireFlashBag implements FlashBagInterface

AutoExpireFlashBag flash message container.

Methods

__construct(string $storageKey = '_sf2_flashes')

Constructor.

string
getName()

Gets this bag's name

setName($name)

No description

initialize(array $flashes)

Initializes the Bag

add(string $type, string $message)

Adds a flash message for type.

array
peek(string $type, array $default = array())

Gets flash messages for a given type.

array
peekAll()

Gets all flash messages.

array
get(string $type, array $default = array())

Gets and clears flash from the stack.

array
all()

Gets and clears flashes from the stack.

setAll(array $messages)

Sets all flash messages.

set(string $type, $messages)

Registers a message for a given type.

boolean
has(string $type)

Has flash messages for a given type?

array
keys()

Returns a list of all defined types.

string
getStorageKey()

Gets the storage key for this bag.

mixed
clear()

Clears out data from bag.

Details

at line line 42
__construct(string $storageKey = '_sf2_flashes')

Constructor.

Parameters

string $storageKey The key used to store flashes in the session.

at line line 51
string getName()

Gets this bag's name

Return Value

string

at line line 56
setName($name)

Parameters

$name

at line line 64
initialize(array $flashes)

Initializes the Bag

Parameters

array $flashes

at line line 78
add(string $type, string $message)

Adds a flash message for type.

Parameters

string $type
string $message

at line line 86
array peek(string $type, array $default = array())

Gets flash messages for a given type.

Parameters

string $type Message category type.
array $default Default value if $type does not exist.

Return Value

array

at line line 94
array peekAll()

Gets all flash messages.

Return Value

array

at line line 102
array get(string $type, array $default = array())

Gets and clears flash from the stack.

Parameters

string $type
array $default Default value if $type does not exist.

Return Value

array

at line line 121
array all()

Gets and clears flashes from the stack.

Return Value

array

at line line 132
setAll(array $messages)

Sets all flash messages.

Parameters

array $messages

at line line 140
set(string $type, $messages)

Registers a message for a given type.

Parameters

string $type
$messages

at line line 148
boolean has(string $type)

Has flash messages for a given type?

Parameters

string $type

Return Value

boolean

at line line 156
array keys()

Returns a list of all defined types.

Return Value

array

at line line 164
string getStorageKey()

Gets the storage key for this bag.

Return Value

string

at line line 172
mixed clear()

Clears out data from bag.

Return Value

mixed Whatever data was contained.