PHP Class Symfony\Component\HttpFoundation\Session

Author: Fabien Potencier ([email protected])
Inheritance: implements Serializable
Afficher le fichier Open project: pmjones/php-framework-benchmarks Class Usage Examples

Protected Properties

Свойство Type Description
$attributes
$defaultLocale
$flashes
$locale
$oldFlashes
$started
$storage

Méthodes publiques

Méthode Description
__construct ( Symfony\Component\HttpFoundation\SessionStorage\SessionStorageInterface $storage, string $defaultLocale = 'en' ) Constructor.
__destruct ( )
all ( ) : array Returns attributes.
clear ( ) Clears all attributes.
clearFlashes ( ) Removes the flash messages.
get ( string $name, mixed $default = null ) : mixed Returns an attribute.
getAttributes ( ) : array Returns attributes.
getFlash ( string $name, string | null $default = null ) : string Gets a flash message.
getFlashes ( ) : array Gets the flash messages.
getId ( ) : mixed Returns the session ID
getLocale ( ) : string Returns the locale
has ( string $name ) : boolean Checks if an attribute is defined.
hasFlash ( string $name ) : boolean Checks whether a flash message exists.
invalidate ( ) Invalidates the current session.
migrate ( ) Migrates the current session to a new session id while maintaining all session attributes.
remove ( string $name ) Removes an attribute.
removeFlash ( string $name ) Removes a flash message.
replace ( array $attributes ) Sets attributes.
save ( )
serialize ( )
set ( string $name, mixed $value ) Sets an attribute.
setAttributes ( array $attributes ) Sets attributes.
setFlash ( string $name, string $value ) Sets a flash message.
setFlashes ( array $values ) Sets the flash messages.
setLocale ( string $locale ) Sets the locale.
start ( ) Starts the session storage.
unserialize ( $serialized )

Private Methods

Méthode Description
setPhpDefaultLocale ( $locale )

Method Details

__construct() public méthode

Constructor.
public __construct ( Symfony\Component\HttpFoundation\SessionStorage\SessionStorageInterface $storage, string $defaultLocale = 'en' )
$storage Symfony\Component\HttpFoundation\SessionStorage\SessionStorageInterface A SessionStorageInterface instance
$defaultLocale string The default locale

__destruct() public méthode

public __destruct ( )

all() public méthode

Returns attributes.
public all ( ) : array
Résultat array Attributes

clear() public méthode

Clears all attributes.
public clear ( )

clearFlashes() public méthode

Removes the flash messages.
public clearFlashes ( )

get() public méthode

Returns an attribute.
public get ( string $name, mixed $default = null ) : mixed
$name string The attribute name
$default mixed The default value
Résultat mixed

getAttributes() public méthode

Returns attributes.
public getAttributes ( ) : array
Résultat array Attributes

getFlash() public méthode

Gets a flash message.
public getFlash ( string $name, string | null $default = null ) : string
$name string
$default string | null
Résultat string

getFlashes() public méthode

Gets the flash messages.
public getFlashes ( ) : array
Résultat array

getId() public méthode

Returns the session ID
public getId ( ) : mixed
Résultat mixed The session ID

getLocale() public méthode

Returns the locale
public getLocale ( ) : string
Résultat string

has() public méthode

Checks if an attribute is defined.
public has ( string $name ) : boolean
$name string The attribute name
Résultat boolean true if the attribute is defined, false otherwise

hasFlash() public méthode

Checks whether a flash message exists.
public hasFlash ( string $name ) : boolean
$name string
Résultat boolean

invalidate() public méthode

Invalidates the current session.
public invalidate ( )

migrate() public méthode

Migrates the current session to a new session id while maintaining all session attributes.
public migrate ( )

remove() public méthode

Removes an attribute.
public remove ( string $name )
$name string

removeFlash() public méthode

Removes a flash message.
public removeFlash ( string $name )
$name string

replace() public méthode

Sets attributes.
public replace ( array $attributes )
$attributes array Attributes

save() public méthode

public save ( )

serialize() public méthode

public serialize ( )

set() public méthode

Sets an attribute.
public set ( string $name, mixed $value )
$name string
$value mixed

setAttributes() public méthode

Sets attributes.
public setAttributes ( array $attributes )
$attributes array Attributes

setFlash() public méthode

Sets a flash message.
public setFlash ( string $name, string $value )
$name string
$value string

setFlashes() public méthode

Sets the flash messages.
public setFlashes ( array $values )
$values array

setLocale() public méthode

Sets the locale.
public setLocale ( string $locale )
$locale string

start() public méthode

Starts the session storage.
public start ( )

unserialize() public méthode

public unserialize ( $serialized )

Property Details

$attributes protected_oe property

protected $attributes

$defaultLocale protected_oe property

protected $defaultLocale

$flashes protected_oe property

protected $flashes

$locale protected_oe property

protected $locale

$oldFlashes protected_oe property

protected $oldFlashes

$started protected_oe property

protected $started

$storage protected_oe property

protected $storage