Apache Zeta Components - high quality PHP components

Apache Zeta Components Manual :: Docs For Class ezcPersistentSessionInstance

PersistentObject::ezcPersistentSessionInstance

Class ezcPersistentSessionInstance

Holds persistent object session instances for global access throughout an application.

Typical usage example:

  1.  $session = new ezcPersistentSession( ezcDbInstance::get(),
  2.                                        new ezcPersistentCodeManager( ... ) );
  3.  ezcPersistentSessionInstance::set( $session ); // set default session
  4.  $session2 = new ezcPersistentSession( ezcDbInstance::get( 'other_db' ),
  5.                                        new ezcPersistentCodeManager( ... ) );
  6.  ezcPersistentSessionInstance::set( $session2, 'extra' ); // set the extra session
  7.  
  8.  // retrieve the sessions
  9.  $session = ezcPersistentSessionInstance::get();
  10.  $session2 = ezcPersistentSessionInstance::get( 'extra' );

Source for this file: /PersistentObject/src/persistent_session_instance.php

Version:   //autogen//

Method Summary

public static void chooseDefault( $identifier )
Sets the database $identifier as default database instance.
public static ezcPersistentSession get( [ $identifier = null] )
Returns the persistent session instance named $identifier.
public static void reset( )
Resets the complete class.
public static void resetDefault( )
Resets the default instance holder.
public static void set( $session , [ $identifier = null] )
Adds the persistent session $session to the list of known instances.

Methods

chooseDefault

static void chooseDefault( string $identifier )

Sets the database $identifier as default database instance.

To retrieve the default database instance call get() with no parameters..

Parameters:
Name Type Description
$identifier string

get

static ezcPersistentSession get( [string $identifier = null] )

Returns the persistent session instance named $identifier.

If $identifier is ommited the default persistent session specified by chooseDefault() is returned.

Parameters:
Name Type Description
$identifier string
Exceptions:
Type Description
ezcPersistentSessionNotFoundException if the specified instance is not found.

reset

static void reset( )

Resets the complete class.

resetDefault

static void resetDefault( )

Resets the default instance holder.

set

static void set( ezcPersistentSessionFoundation $session , [string $identifier = null] )

Adds the persistent session $session to the list of known instances.

If $identifier is specified the persistent session instance can be retrieved later using the same identifier. If $identifier is ommited the default instance will be set.

Parameters:
Name Type Description
$session ezcPersistentSessionFoundation
$identifier string the identifier of the database handler
Documentation generated by phpDocumentor 1.4.3