Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Zend_Memory_Value Class Reference
Inheritance diagram for Zend_Memory_Value:

Public Member Functions

 __construct ($value, Zend_Memory_Container_Movable $container)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $char)
 
 offsetUnset ($offset)
 
 __toString ()
 
getRef ()
 
 startTrace ()
 

Detailed Description

Definition at line 35 of file Value.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $value,
Zend_Memory_Container_Movable  $container 
)

Object constructor

Parameters
string$value
Zend_Memory_Container_Movable$container

Object is marked as just modified by memory manager So we don't need to trace followed object modifications and object is processed (and marked as traced) when another memory object is modified.

It reduces overall numberr of calls necessary to modification trace

Definition at line 64 of file Value.php.

65  {
66  $this->_container = $container;
67 
68  $this->_value = (string)$value;
69 
78  $this->_trace = false;
79  }
$value
Definition: gender.phtml:16

Member Function Documentation

◆ __toString()

__toString ( )

To string conversion

Returns
string

Definition at line 145 of file Value.php.

146  {
147  return $this->_value;
148  }

◆ getRef()

& getRef ( )

Get string value reference

Must be used for value access before PHP v 5.2 or may be used for performance considerations

Definition at line 160 of file Value.php.

161  {
162  return $this->_value;
163  }

◆ offsetExists()

offsetExists (   $offset)

ArrayAccess interface method returns true if string offset exists

Parameters
integer$offset
Returns
boolean

Definition at line 89 of file Value.php.

90  {
91  return $offset >= 0 && $offset < strlen($this->_value);
92  }

◆ offsetGet()

offsetGet (   $offset)

ArrayAccess interface method Get character at $offset position

Parameters
integer$offset
Returns
string

Definition at line 101 of file Value.php.

102  {
103  return $this->_value[$offset];
104  }

◆ offsetSet()

offsetSet (   $offset,
  $char 
)

ArrayAccess interface method Set character at $offset position

Parameters
integer$offset
string$char

Definition at line 113 of file Value.php.

114  {
115  $this->_value[$offset] = $char;
116 
117  if ($this->_trace) {
118  $this->_trace = false;
119  $this->_container->processUpdate();
120  }
121  }

◆ offsetUnset()

offsetUnset (   $offset)

ArrayAccess interface method Unset character at $offset position

Parameters
integer$offset

Definition at line 129 of file Value.php.

130  {
131  unset($this->_value[$offset]);
132 
133  if ($this->_trace) {
134  $this->_trace = false;
135  $this->_container->processUpdate();
136  }
137  }

◆ startTrace()

startTrace ( )

Start modifications trace

Must be used for value access before PHP v 5.2 or may be used for performance considerations

Definition at line 173 of file Value.php.

174  {
175  $this->_trace = true;
176  }

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