Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 /*
|
Chris@0
|
4 * This file is part of the Symfony package.
|
Chris@0
|
5 *
|
Chris@0
|
6 * (c) Fabien Potencier <fabien@symfony.com>
|
Chris@0
|
7 *
|
Chris@0
|
8 * For the full copyright and license information, please view the LICENSE
|
Chris@0
|
9 * file that was distributed with this source code.
|
Chris@0
|
10 */
|
Chris@0
|
11
|
Chris@0
|
12 namespace Symfony\Component\HttpFoundation\Session\Flash;
|
Chris@0
|
13
|
Chris@0
|
14 use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
|
Chris@0
|
15
|
Chris@0
|
16 /**
|
Chris@0
|
17 * FlashBagInterface.
|
Chris@0
|
18 *
|
Chris@0
|
19 * @author Drak <drak@zikula.org>
|
Chris@0
|
20 */
|
Chris@0
|
21 interface FlashBagInterface extends SessionBagInterface
|
Chris@0
|
22 {
|
Chris@0
|
23 /**
|
Chris@0
|
24 * Adds a flash message for type.
|
Chris@0
|
25 *
|
Chris@0
|
26 * @param string $type
|
Chris@17
|
27 * @param mixed $message
|
Chris@0
|
28 */
|
Chris@0
|
29 public function add($type, $message);
|
Chris@0
|
30
|
Chris@0
|
31 /**
|
Chris@0
|
32 * Registers a message for a given type.
|
Chris@0
|
33 *
|
Chris@0
|
34 * @param string $type
|
Chris@0
|
35 * @param string|array $message
|
Chris@0
|
36 */
|
Chris@0
|
37 public function set($type, $message);
|
Chris@0
|
38
|
Chris@0
|
39 /**
|
Chris@0
|
40 * Gets flash messages for a given type.
|
Chris@0
|
41 *
|
Chris@0
|
42 * @param string $type Message category type
|
Chris@0
|
43 * @param array $default Default value if $type does not exist
|
Chris@0
|
44 *
|
Chris@0
|
45 * @return array
|
Chris@0
|
46 */
|
Chris@17
|
47 public function peek($type, array $default = []);
|
Chris@0
|
48
|
Chris@0
|
49 /**
|
Chris@0
|
50 * Gets all flash messages.
|
Chris@0
|
51 *
|
Chris@0
|
52 * @return array
|
Chris@0
|
53 */
|
Chris@0
|
54 public function peekAll();
|
Chris@0
|
55
|
Chris@0
|
56 /**
|
Chris@0
|
57 * Gets and clears flash from the stack.
|
Chris@0
|
58 *
|
Chris@0
|
59 * @param string $type
|
Chris@0
|
60 * @param array $default Default value if $type does not exist
|
Chris@0
|
61 *
|
Chris@0
|
62 * @return array
|
Chris@0
|
63 */
|
Chris@17
|
64 public function get($type, array $default = []);
|
Chris@0
|
65
|
Chris@0
|
66 /**
|
Chris@0
|
67 * Gets and clears flashes from the stack.
|
Chris@0
|
68 *
|
Chris@0
|
69 * @return array
|
Chris@0
|
70 */
|
Chris@0
|
71 public function all();
|
Chris@0
|
72
|
Chris@0
|
73 /**
|
Chris@0
|
74 * Sets all flash messages.
|
Chris@0
|
75 */
|
Chris@0
|
76 public function setAll(array $messages);
|
Chris@0
|
77
|
Chris@0
|
78 /**
|
Chris@0
|
79 * Has flash messages for a given type?
|
Chris@0
|
80 *
|
Chris@0
|
81 * @param string $type
|
Chris@0
|
82 *
|
Chris@0
|
83 * @return bool
|
Chris@0
|
84 */
|
Chris@0
|
85 public function has($type);
|
Chris@0
|
86
|
Chris@0
|
87 /**
|
Chris@0
|
88 * Returns a list of all defined types.
|
Chris@0
|
89 *
|
Chris@0
|
90 * @return array
|
Chris@0
|
91 */
|
Chris@0
|
92 public function keys();
|
Chris@0
|
93 }
|