4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\HttpFoundation\Session\Flash;
14 use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
19 * @author Drak <drak@zikula.org>
21 interface FlashBagInterface extends SessionBagInterface
24 * Adds a flash message for type.
27 * @param string $message
29 public function add($type, $message);
32 * Registers a message for a given type.
35 * @param string|array $message
37 public function set($type, $message);
40 * Gets flash messages for a given type.
42 * @param string $type Message category type
43 * @param array $default Default value if $type does not exist
47 public function peek($type, array $default = array());
50 * Gets all flash messages.
54 public function peekAll();
57 * Gets and clears flash from the stack.
60 * @param array $default Default value if $type does not exist
64 public function get($type, array $default = array());
67 * Gets and clears flashes from the stack.
71 public function all();
74 * Sets all flash messages.
76 public function setAll(array $messages);
79 * Has flash messages for a given type?
85 public function has($type);
88 * Returns a list of all defined types.
92 public function keys();