Subversion Repositories php-qbpwcf

Rev

Details | Last modification | View Log | RSS feed

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