Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Attributes
Zend_Http_UserAgent_Storage_Session Class Reference
Inheritance diagram for Zend_Http_UserAgent_Storage_Session:
Zend_Http_UserAgent_Storage

Public Member Functions

 __construct ($options=null)
 
 getNamespace ()
 
 getMember ()
 
 isEmpty ()
 
 read ()
 
 write ($content)
 
 clear ()
 

Data Fields

const NAMESPACE_DEFAULT = 'Zend_Http_UserAgent'
 
const MEMBER_DEFAULT = 'storage'
 

Protected Attributes

 $_session
 
 $_namespace
 
 $_member
 

Detailed Description

Definition at line 38 of file Session.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $options = null)

Sets session storage options and initializes session namespace object

Expects options to contain 0 or more of the following keys:

  • browser_type – maps to "namespace" internally
  • member
Parameters
null | array | object$options
Returns
void
Exceptions
Zend_Http_UserAgent_Storage_Exceptionon invalid $options argument

Definition at line 82 of file Session.php.

83  {
84  if (is_object($options) && method_exists($options, 'toArray')) {
85  $options = $options->toArray();
86  } elseif (is_object($options)) {
87  $options = (array) $options;
88  }
89  if (null !== $options && !is_array($options)) {
90  #require_once 'Zend/Http/UserAgent/Storage/Exception.php';
91  throw new Zend_Http_UserAgent_Storage_Exception(sprintf(
92  'Expected array or object options; "%s" provided',
93  gettype($options)
94  ));
95  }
96 
97  // add '.' to prevent the message ''Session namespace must not start with a number'
98  $this->_namespace = '.'
99  . (isset($options['browser_type'])
100  ? $options['browser_type']
102  $this->_member = isset($options['member']) ? $options['member'] : self::MEMBER_DEFAULT;
103  $this->_session = new Zend_Session_Namespace($this->_namespace);
104  }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17

Member Function Documentation

◆ clear()

clear ( )

Defined by Zend_Http_UserAgent_Storage

Returns
void

Implements Zend_Http_UserAgent_Storage.

Definition at line 162 of file Session.php.

163  {
164  unset($this->_session->{$this->_member});
165  }

◆ getMember()

getMember ( )

Returns the name of the session object member

Returns
string

Definition at line 121 of file Session.php.

122  {
123  return $this->_member;
124  }

◆ getNamespace()

getNamespace ( )

Returns the session namespace name

Returns
string

Definition at line 111 of file Session.php.

112  {
113  return $this->_namespace;
114  }

◆ isEmpty()

isEmpty ( )

Defined by Zend_Http_UserAgent_Storage

Returns
boolean

Implements Zend_Http_UserAgent_Storage.

Definition at line 131 of file Session.php.

132  {
133  return empty($this->_session->{$this->_member});
134  }

◆ read()

read ( )

Defined by Zend_Http_UserAgent_Storage

Returns
mixed

Implements Zend_Http_UserAgent_Storage.

Definition at line 141 of file Session.php.

142  {
143  return $this->_session->{$this->_member};
144  }

◆ write()

write (   $content)

Defined by Zend_Http_UserAgent_Storage

Parameters
mixed$contents
Returns
void

Implements Zend_Http_UserAgent_Storage.

Definition at line 152 of file Session.php.

153  {
154  $this->_session->{$this->_member} = $content;
155  }

Field Documentation

◆ $_member

$_member
protected

Definition at line 69 of file Session.php.

◆ $_namespace

$_namespace
protected

Definition at line 62 of file Session.php.

◆ $_session

$_session
protected

Definition at line 55 of file Session.php.

◆ MEMBER_DEFAULT

const MEMBER_DEFAULT = 'storage'

Default session object member name

Definition at line 48 of file Session.php.

◆ NAMESPACE_DEFAULT

const NAMESPACE_DEFAULT = 'Zend_Http_UserAgent'

Default session namespace

Definition at line 43 of file Session.php.


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