ZMObject
|
+--ZMSession
public class ZMSession
extends ZMObject
| Constructor Summary | |
|---|---|
Create new instance. |
|
| Method Summary | |
|---|---|
| void | clear() Clear the session. |
| void | Clear all session messages. |
| int | Get the account id. |
| string | Get the client ip address. |
| string | Get the client host name. |
| string | Get currency code. |
| ZMLanguage | Get the language. |
| int | Get the language id. |
| string | Check if a follow up url exists that should be loaded after a login. |
| void | getMessages(array Messages.) Get all session messages. |
| char | getType() Returns the current session type. |
| mixed | getValue(string name) Get a session value. |
| mixed | Get the current shopping cart. |
| boolean | Returns true if the user is not logged in at all. |
| boolean | isGuest() Returns true if the user is a guest user. |
| boolean | isOpen() Check if a proper session has been started yet. |
| boolean | Returns true if the user is a registered user. |
| boolean | isValid() Check if the current session is valid and open. |
| void | Mark current request for return after login. |
| void | recreate(boolean force) Recreate session. |
| void | Restore the shopping cart contents. |
| void | setAccount(ZMAccount account) Set the account for the current session. |
| void | setCurrencyCode(string currencyCode) Set currency code. |
| void | setLanguage(ZMLanguage language) Set the language. |
| void | setMessages(array messages) Save the given messages in the session. |
| void | setValue(string name, mixed value) Create a session value. |
| Methods inherited from org.zenmagick.ZMObject | |
|---|---|
| backtrace, create, log, singleton | |
public ZMSession()
Create new instance. /
public void clear()
Clear the session.
This will effectively logoff the curent account. /
public void clearMessages()
Clear all session messages. /
public int getAccountId()
Get the account id.
0.public string getClientAddress()
Get the client ip address.
null.public string getClientHostname()
Get the client host name.
null.public string getCurrencyCode()
Get currency code.
null.public ZMLanguage getLanguage()
Get the language.
null.public int getLanguageId()
Get the language id.
public string getLoginFollowUp()
Check if a follow up url exists that should be loaded after a login.
null.public void getMessages(array Messages.)
Get all session messages.
public char getType()
Returns the current session type.
This type corresponds with the account type.
public mixed getValue(string name)
Get a session value.
null.public mixed getZCShoppingCart()
Get the current shopping cart.
public boolean isAnonymous()
Returns true if the user is not logged in at all.
This is the lowest level of identity.
true if the current user is anonymous, false if not.public boolean isGuest()
Returns true if the user is a guest user.
This status level is in the middle between registered and anonymous.
true if the current user is an guest, false if not.public boolean isOpen()
Check if a proper session has been started yet.
NOTE: Since this method calls session_start() internally
as part of its logic, right now it can't be called twice...
false if not.public boolean isRegistered()
Returns true if the user is a registered user.
This si the highest status level.
true if the current user is registered, false if not.public boolean isValid()
Check if the current session is valid and open.
true if a valid session exists, false if not.public void markRequestAsLoginFollowUp()
Mark current request for return after login. /
public void recreate(boolean force)
Recreate session.
true, force recreation of the session, even if this is disabled.public void restoreCart()
Restore the shopping cart contents. /
public void setAccount(ZMAccount account)
Set the account for the current session.
public void setCurrencyCode(string currencyCode)
Set currency code.
public void setLanguage(ZMLanguage language)
Set the language.
public void setMessages(array messages)
Save the given messages in the session.
ZMMessage objects.public void setValue(string name, mixed value)
Create a session value.
Simple wrapper around
$_SESSIONto centralise access.