symfony API

sfUser Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

Packages

You are currently browsing the symfony API for the 1.4 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

sfUser wraps a client session and provides accessor methods for user

Inheritence

sfBasicSecurityUser  <  sfUser

Method Summary

  • getAttribute()
  • getAttributeHolder()
  • string getCulture()
    Gets culture.
  • mixed getFlash($name, $default)
    Gets a flash variable.
  • array getOptions()
    Returns the initialization options
  • hasAttribute()
  • bool hasFlash($name)
    Returns true if a flash variable of the specified name exists.
  • Boolean initialize($dispatcher, $storage, $options)
    Initializes this sfUser.
  • Boolean offsetExists($name)
    Returns true if the user attribute exists (implements the ArrayAccess interface).
  • mixed offsetGet($name)
    Returns the user attribute associated with the name (implements the ArrayAccess interface).
  • offsetSet($offset, $value)
    Sets the user attribute associated with the offset (implements the ArrayAccess interface).
  • offsetUnset($offset)
    Unsets the user attribute associated with the offset (implements the ArrayAccess interface).
  • setAttribute()
  • setCulture($culture)
    Sets the user culture.
  • setFlash($name, $value, $persist)
    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()
    Class constructor.

Method Details

  • getAttribute ()

  • getAttributeHolder ()

  • (string) getCulture ()

    Gets culture.

  • (mixed) getFlash ($name, $default)

    $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

  • (array) getOptions ()

    Returns the initialization options

    returns The options used to initialize sfUser

  • hasAttribute ()

  • (bool) hasFlash ($name)

    $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)

    $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.

  • (Boolean) offsetExists ($name)

    $name The name of the user attribute

    Returns true if the user attribute exists (implements the ArrayAccess interface).

    returns true if the user attribute exists, false otherwise

  • (mixed) offsetGet ($name)

    $name The offset of the value to get

    Returns the user attribute associated with the name (implements the ArrayAccess interface).

    returns The user attribute if exists, null otherwise

  • offsetSet ($offset, $value)

    $offset The parameter name
    $value The parameter value

    Sets the user attribute associated with the offset (implements the ArrayAccess interface).

  • offsetUnset ($offset)

    $offset The parameter name

    Unsets the user attribute associated with the offset (implements the ArrayAccess interface).

  • setAttribute ()

  • setCulture ($culture)

    Sets the user culture.

  • setFlash ($name, $value, $persist)

    $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.

  • shutdown ()

    Executes the shutdown procedure.

  • (mixed) __call ($method, $arguments)

    $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 ()

    Class constructor.