Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\HttpFoundation\Session\Flash; Chris@0: Chris@0: use Symfony\Component\HttpFoundation\Session\SessionBagInterface; Chris@0: Chris@0: /** Chris@0: * FlashBagInterface. Chris@0: * Chris@0: * @author Drak Chris@0: */ Chris@0: interface FlashBagInterface extends SessionBagInterface Chris@0: { Chris@0: /** Chris@0: * Adds a flash message for type. Chris@0: * Chris@0: * @param string $type Chris@17: * @param mixed $message Chris@0: */ Chris@0: public function add($type, $message); Chris@0: Chris@0: /** Chris@0: * Registers a message for a given type. Chris@0: * Chris@0: * @param string $type Chris@0: * @param string|array $message Chris@0: */ Chris@0: public function set($type, $message); Chris@0: Chris@0: /** Chris@0: * Gets flash messages for a given type. Chris@0: * Chris@0: * @param string $type Message category type Chris@0: * @param array $default Default value if $type does not exist Chris@0: * Chris@0: * @return array Chris@0: */ Chris@17: public function peek($type, array $default = []); Chris@0: Chris@0: /** Chris@0: * Gets all flash messages. Chris@0: * Chris@0: * @return array Chris@0: */ Chris@0: public function peekAll(); Chris@0: Chris@0: /** Chris@0: * Gets and clears flash from the stack. Chris@0: * Chris@0: * @param string $type Chris@0: * @param array $default Default value if $type does not exist Chris@0: * Chris@0: * @return array Chris@0: */ Chris@17: public function get($type, array $default = []); Chris@0: Chris@0: /** Chris@0: * Gets and clears flashes from the stack. Chris@0: * Chris@0: * @return array Chris@0: */ Chris@0: public function all(); Chris@0: Chris@0: /** Chris@0: * Sets all flash messages. Chris@0: */ Chris@0: public function setAll(array $messages); Chris@0: Chris@0: /** Chris@0: * Has flash messages for a given type? Chris@0: * Chris@0: * @param string $type Chris@0: * Chris@0: * @return bool Chris@0: */ Chris@0: public function has($type); Chris@0: Chris@0: /** Chris@0: * Returns a list of all defined types. Chris@0: * Chris@0: * @return array Chris@0: */ Chris@0: public function keys(); Chris@0: }