Bag.php
3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php
namespace Phalcon\Session {
/**
* Phalcon\Session\Bag
*
* This component helps to separate session data into "namespaces". Working by this way
* you can easily create groups of session variables into the application
*
*<code>
* $user = new \Phalcon\Session\Bag('user');
* $user->name = "Kimbra Johnson";
* $user->age = 22;
*</code>
*/
class Bag implements \Phalcon\DI\InjectionAwareInterface, \Phalcon\Session\BagInterface {
protected $_dependencyInjector;
protected $_name;
protected $_data;
protected $_initialized;
protected $_session;
/**
* \Phalcon\Session\Bag constructor
*
* @param string $name
*/
public function __construct($name){ }
/**
* Sets the DependencyInjector container
*
* @param \Phalcon\DiInterface $dependencyInjector
*/
public function setDI($dependencyInjector){ }
/**
* Returns the DependencyInjector container
*
* @return \Phalcon\DiInterface
*/
public function getDI(){ }
/**
* Initializes the session bag. This method must not be called directly, the class calls it when its internal data is accesed
*/
public function initialize(){ }
/**
* Destroyes the session bag
*
*<code>
* $user->destroy();
*</code>
*/
public function destroy(){ }
/**
* Sets a value in the session bag
*
*<code>
* $user->set('name', 'Kimbra');
*</code>
*
* @param string $property
* @param string $value
*/
public function set($property, $value){ }
/**
* Magic setter to assign values to the session bag.
* Alias for \Phalcon\Session\Bag::set()
*
*<code>
* $user->name = "Kimbra";
*</code>
*
* @param string $property
* @param string $value
*/
public function __set($property, $value){ }
/**
* Obtains a value from the session bag optionally setting a default value
*
*<code>
* echo $user->get('name', 'Kimbra');
*</code>
*
* @param string $property
* @param string $defaultValue
* @return mixed
*/
public function get($property, $defaultValue=null){ }
/**
* Magic getter to obtain values from the session bag.
* Alias for \Phalcon\Session\Bag::get()
*
*<code>
* echo $user->name;
*</code>
*
* @param string $property
* @return string
*/
public function __get($property){ }
/**
* Check whether a property is defined in the internal bag
*
*<code>
* var_dump($user->has('name'));
*</code>
*
* @param string $property
* @return boolean
*/
public function has($property){ }
/**
* Magic isset to check whether a property is defined in the bag.
* Alias for \Phalcon\Session\Bag::has()
*
*<code>
* var_dump(isset($user['name']));
*</code>
*
* @param string $property
* @return boolean
*/
public function __isset($property){ }
/**
* Removes a property from the internal bag
*
*<code>
* $user->remove('name');
*</code>
*
* @param string $property
* @return boolean
*/
public function remove($property){ }
/**
* Magic unset to remove items using the property syntax.
* Alias for \Phalcon\Session\Bag::remove()
*
*<code>
* unset($user['name']);
*</code>
*
* @param string $property
* @return boolean
*/
public function __unset($property){ }
}
}