sfUser wraps a client session and provides accessor methods for user
attributes. It also makes storing and retrieving multiple page form data
rather easy by allowing user attributes to be stored in namespaces, which
help organize data.
Method Summary
-
getAttribute($name, $default = null, $ns = null)
-
getAttributeHolder()
-
string
getCulture()
Gets culture.
-
mixed
getFlash($name, $default = null)
Gets a flash variable.
-
array
getOptions()
Returns the initialization options
-
hasAttribute($name, $ns = null)
-
bool
hasFlash($name)
Returns true if a flash variable of the specified name exists.
-
Boolean
initialize($dispatcher, $storage, $options = array())
Initializes this sfUser.
-
setAttribute($name, $value, $ns = null)
-
setCulture($culture)
Sets the user culture.
-
setFlash($name, $value, $persist = true)
Sets a flash variable that will be passed to the very next action.
-
shutdown()
Executes the shutdown procedure.
-
mixed
__call($method, $arguments)
Calls methods defined via sfEventDispatcher.
-
__construct($dispatcher, $storage, $options = array())
Class constructor.
Method Details
-
getAttribute ($name, $default = null, $ns = null)
Browse code
-
-
(string) getCulture ()
Browse code
Gets culture.
-
(mixed) getFlash ($name, $default = null)
Browse code
| $name |
The name of the flash variable
|
| $default |
The default value returned when named variable does not exist.
|
Gets a flash variable.
returns The value of the flash variable
-
Returns the initialization options
returns The options used to initialize sfUser
-
hasAttribute ($name, $ns = null)
Browse code
-
(bool) hasFlash ($name)
Browse code
| $name |
The name of the flash variable
|
Returns true if a flash variable of the specified name exists.
returns true if the variable exists, false otherwise
-
(Boolean) initialize ($dispatcher, $storage, $options = array())
Browse code
| $dispatcher |
An sfEventDispatcher instance.
|
| $storage |
An sfStorage instance.
|
| $options |
An associative array of options.
|
Initializes this sfUser.
Available options: * auto_shutdown: Whether to automatically save the changes to the session (true by default)
* culture: The user culture
* default_culture: The default user culture (en by default)
* use_flash: Whether to enable flash usage (false by default)
* logging: Whether to enable logging (false by default)
returns true, if initialization completes successfully, otherwise false.
-
setAttribute ($name, $value, $ns = null)
Browse code
-
Sets the user culture.
-
setFlash ($name, $value, $persist = true)
Browse code
| $name |
The name of the flash variable
|
| $value |
The value of the flash variable
|
| $persist |
true if the flash have to persist for the following request (true by
default)
|
Sets a flash variable that will be passed to the very next action.
-
Executes the shutdown procedure.
-
(mixed) __call ($method, $arguments)
Browse code
| $method |
The method name
|
| $arguments |
The method arguments
|
Calls methods defined via sfEventDispatcher.
returns The returned value of the called method
throws sfException If the calls fails
-
__construct ($dispatcher, $storage, $options = array())
Browse code
| $dispatcher |
|
| $storage |
|
| $options |
|
Class constructor.
|