Class: Session

Source Location: /CORE/system/classes/core/Session.php

Class Session

Class Overview

Represents a BIGACE Session, which initializes values like Community ID, User ID and language.

Located in /CORE/system/classes/core/Session.php [line 39]



		
				Author(s):
		
  • Kevin Papst
Information Tags:
Version:  $Id: Session.php,v 1.13 2008/11/30 15:40:01 kpapst Exp $
Copyright:  Copyright (C) Kevin Papst
License:  GNU Public License

Methods

[ Top ]
Method Summary
Session   Session()  
void   destroy()   Destroy the current session, including the delete from database.
void   finalize()   Writes the Session Data into the Database for persistence issues.
Consumer   getCommunity()   Fetch the Community for this Session.
Consumer   getConsumer()   Fetch the Consumer this Session belongs to.
String   getLanguageID()   Returns the Session Language ID.
String   getSessionID()   Returns the Session ID.
mixed   getSessionValue()   Returns the Session Value with the given Key.
Principal   getUser()   Returns the actual User.
int   getUserID()   Returns the ID of the User.
boolean   isAnonymous()   Returns if the current Session is a anonymous Session.
boolean   isSuperUser()   Return if the current user is a SuperUser.
boolean   isValueSet()   Checks if the a Value with the given key is set within this Session.
void   setLanguage()   Sets the Language (Locale) of this Session.
void   setSessionValue()   Sets the given Key-Value Combination for this Session.
void   setUserByID()   Sets the User by its ID.

[ Top ]
Methods
Constructor Session  [line 54]

  Session Session( $community  )

Parameters:
   $community: 


[ Top ]
destroy  [line 221]

  void destroy( [boolean $deleteCookie = true]  )

Destroy the current session, including the delete from database.

Parameters:
boolean   $deleteCookie:  whether the cookie should be kept or deleted


[ Top ]
finalize  [line 237]

  void finalize( )

Writes the Session Data into the Database for persistence issues.



[ Top ]
getCommunity  [line 98]

  Consumer getCommunity( )

Fetch the Community for this Session.


API Tags:
Return:  the Community for this Session


[ Top ]
getConsumer  [line 91]

  Consumer getConsumer( )

Fetch the Consumer this Session belongs to.


API Tags:
Return:  the Consumer for this Session
Deprecated:  use getCommunity()


[ Top ]
getLanguageID  [line 174]

  String getLanguageID( )

Returns the Session Language ID.

This can be different from the System Default language and also different from the Users Language!


API Tags:
Return:  the Language ID, here the Locale


[ Top ]
getSessionID  [line 213]

  String getSessionID( )

Returns the Session ID.


API Tags:
Return:  the Session ID


[ Top ]
getSessionValue  [line 144]

  mixed getSessionValue( String $key  )

Returns the Session Value with the given Key.

If none could be found, it returns null.

Parameters:
String   $key:  the Key of the searched Value

API Tags:
Return:  the Value or null


[ Top ]
getUser  [line 190]

  Principal getUser( )

Returns the actual User.


API Tags:
Return:  the Principal using this Session


[ Top ]
getUserID  [line 182]

  int getUserID( )

Returns the ID of the User.


API Tags:
Return:  the User ID


[ Top ]
isAnonymous  [line 205]

  boolean isAnonymous( )

Returns if the current Session is a anonymous Session.


API Tags:
Return:  whether we use an anonymous session or not


[ Top ]
isSuperUser  [line 198]

  boolean isSuperUser( )

Return if the current user is a SuperUser.


API Tags:
Return:  true if current user is the "community good"


[ Top ]
isValueSet  [line 121]

  boolean isValueSet( String $key  )

Checks if the a Value with the given key is set within this Session.

Parameters:
String   $key:  the Key foe the searched Value

API Tags:
Return:  whether the Key is set or not


[ Top ]
setLanguage  [line 158]

  void setLanguage( Language $lang  )

Sets the Language (Locale) of this Session.

The Parameter may not be a Language class, but the Locale String (Language->getLocale()).

Parameters:
Language   $lang:  the Language Locale to be set


[ Top ]
setSessionValue  [line 132]

  void setSessionValue( String $key, mixed $value  )

Sets the given Key-Value Combination for this Session.

The Value must be serializable using the PHP method

!

Parameters:
String   $key:  the Key for this Session value
mixed   $value:  the Value to set


[ Top ]
setUserByID  [line 106]

  void setUserByID( int $uid  )

Sets the User by its ID.

Parameters:
int   $uid:  the User ID


[ Top ]