Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Value.php
Go to the documentation of this file.
1 <?php
35 class Zend_Memory_Value implements ArrayAccess {
41  private $_value;
42 
48  private $_container;
49 
55  private $_trace;
56 
57 
64  public function __construct($value, Zend_Memory_Container_Movable $container)
65  {
66  $this->_container = $container;
67 
68  $this->_value = (string)$value;
69 
78  $this->_trace = false;
79  }
80 
81 
89  public function offsetExists($offset)
90  {
91  return $offset >= 0 && $offset < strlen($this->_value);
92  }
93 
101  public function offsetGet($offset)
102  {
103  return $this->_value[$offset];
104  }
105 
113  public function offsetSet($offset, $char)
114  {
115  $this->_value[$offset] = $char;
116 
117  if ($this->_trace) {
118  $this->_trace = false;
119  $this->_container->processUpdate();
120  }
121  }
122 
129  public function offsetUnset($offset)
130  {
131  unset($this->_value[$offset]);
132 
133  if ($this->_trace) {
134  $this->_trace = false;
135  $this->_container->processUpdate();
136  }
137  }
138 
139 
145  public function __toString()
146  {
147  return $this->_value;
148  }
149 
150 
160  public function &getRef()
161  {
162  return $this->_value;
163  }
164 
173  public function startTrace()
174  {
175  $this->_trace = true;
176  }
177 }
offsetUnset($offset)
Definition: Value.php:129
offsetSet($offset, $char)
Definition: Value.php:113
$value
Definition: gender.phtml:16
__construct($value, Zend_Memory_Container_Movable $container)
Definition: Value.php:64
offsetExists($offset)
Definition: Value.php:89
offsetGet($offset)
Definition: Value.php:101