Mage_Core_Model_Session_Abstract_Zend Class Reference

Inheritance diagram for Mage_Core_Model_Session_Abstract_Zend:

Varien_Object

List of all members.

Public Member Functions

 getNamespace ()
 start ()
 init ($namespace)
 setData ($key, $value='', $isChanged=false)
 getData ($var=null, $clear=false)
 unsetAll ()
 getSessionId ()
 setSessionId ($id=null)

Protected Attributes

 $_namespace


Detailed Description

Definition at line 34 of file Zend.php.


Member Function Documentation

getData ( var = null,
clear = false 
)

Redeclaration object getter

Parameters:
string $var
bool $clear
Returns:
mixed

Reimplemented from Varien_Object.

Definition at line 121 of file Zend.php.

00122     {
00123         if (!$this->_namespace->data) {
00124             $this->_namespace->data = new Varien_Object();
00125         }
00126 
00127         $data = $this->_namespace->data->getData($var);
00128 
00129         if ($clear) {
00130             $this->_namespace->data->unsetData($var);
00131         }
00132 
00133         return $data;
00134     }

getNamespace (  ) 

Definition at line 43 of file Zend.php.

00044     {
00045         return $this->_namespace;
00046     }

getSessionId (  ) 

Retrieve current session identifier

Returns:
string

Definition at line 152 of file Zend.php.

00153     {
00154         return Zend_Session::getId();
00155     }

init ( namespace  ) 

Initialization session namespace

Parameters:
string $namespace

Definition at line 86 of file Zend.php.

00087     {
00088         if (!Zend_Session::sessionExists()) {
00089             $this->start();
00090         }
00091 
00092         Varien_Profiler::start(__METHOD__.'/init');
00093         $this->_namespace = new Zend_Session_Namespace($namespace, Zend_Session_Namespace::SINGLE_INSTANCE);
00094         Varien_Profiler::stop(__METHOD__.'/init');
00095         return $this;
00096     }

setData ( key,
value = '',
isChanged = false 
)

Redeclaration object setter

Parameters:
string $key
mixed $value
Returns:
Mage_Core_Model_Session_Abstract

Definition at line 105 of file Zend.php.

00106     {
00107         if (!$this->_namespace->data) {
00108             $this->_namespace->data = new Varien_Object();
00109         }
00110         $this->_namespace->data->setData($key, $value, $isChanged);
00111         return $this;
00112     }

setSessionId ( id = null  ) 

Definition at line 157 of file Zend.php.

00158     {
00159         if (!is_null($id)) {
00160             Zend_Session::setId($id);
00161         }
00162         return $this;
00163     }

start (  ) 

Definition at line 48 of file Zend.php.

00049     {
00050         Varien_Profiler::start(__METHOD__.'/setOptions');
00051         $options = array(
00052             'save_path'=>Mage::getBaseDir('session'),
00053             'use_only_cookies'=>'off',
00054         );
00055         if ($this->getCookieDomain()) {
00056             $options['cookie_domain'] = $this->getCookieDomain();
00057         }
00058         if ($this->getCookiePath()) {
00059             $options['cookie_path'] = $this->getCookiePath();
00060         }
00061         if ($this->getCookieLifetime()) {
00062             $options['cookie_lifetime'] = $this->getCookieLifetime();
00063         }
00064         Zend_Session::setOptions($options);
00065         Varien_Profiler::stop(__METHOD__.'/setOptions');
00066 /*
00067         Varien_Profiler::start(__METHOD__.'/setHandler');
00068         $sessionResource = Mage::getResourceSingleton('core/session');
00069         if ($sessionResource->hasConnection()) {
00070             Zend_Session::setSaveHandler($sessionResource);
00071         }
00072         Varien_Profiler::stop(__METHOD__.'/setHandler');
00073 */
00074         Varien_Profiler::start(__METHOD__.'/start');
00075         Zend_Session::start();
00076         Varien_Profiler::stop(__METHOD__.'/start');
00077 
00078         return $this;
00079     }

unsetAll (  ) 

Cleare session data

Returns:
Mage_Core_Model_Session_Abstract

Definition at line 141 of file Zend.php.

00142     {
00143         $this->_namespace->unsetAll();
00144         return $this;
00145     }


Member Data Documentation

$_namespace [protected]

Definition at line 41 of file Zend.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:00 2009 for Magento by  doxygen 1.5.8