Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Abstract.php
Go to the documentation of this file.
1 <?php
31 abstract class Zend_Mail_Storage_Abstract implements Countable, ArrayAccess, SeekableIterator
32 {
37  protected $_has = array('uniqueid' => true,
38  'delete' => false,
39  'create' => false,
40  'top' => false,
41  'fetchPart' => true,
42  'flags' => false);
43 
48  protected $_iterationPos = 0;
49 
54  protected $_iterationMax = null;
55 
60  protected $_messageClass = 'Zend_Mail_Message';
61 
75  public function __get($var)
76  {
77  if (strpos($var, 'has') === 0) {
78  $var = strtolower(substr($var, 3));
79  return isset($this->_has[$var]) ? $this->_has[$var] : null;
80  }
81 
85  #require_once 'Zend/Mail/Storage/Exception.php';
86  throw new Zend_Mail_Storage_Exception($var . ' not found');
87  }
88 
89 
95  public function getCapabilities()
96  {
97  return $this->_has;
98  }
99 
100 
107  abstract public function countMessages();
108 
109 
116  abstract public function getSize($id = 0);
117 
118 
125  abstract public function getMessage($id);
126 
127 
136  abstract public function getRawHeader($id, $part = null, $topLines = 0);
137 
145  abstract public function getRawContent($id, $part = null);
146 
153  abstract public function __construct($params);
154 
155 
159  public function __destruct()
160  {
161  $this->close();
162  }
163 
164 
171  abstract public function close();
172 
173 
179  abstract public function noop();
180 
186  abstract public function removeMessage($id);
187 
197  abstract public function getUniqueId($id = null);
198 
209  abstract public function getNumberByUniqueId($id);
210 
211  // interface implementations follows
212 
218  public function count()
219  {
220  return $this->countMessages();
221  }
222 
223 
230  public function offsetExists($id)
231  {
232  try {
233  if ($this->getMessage($id)) {
234  return true;
235  }
236  } catch(Zend_Mail_Storage_Exception $e) {}
237 
238  return false;
239  }
240 
241 
248  public function offsetGet($id)
249  {
250  return $this->getMessage($id);
251  }
252 
253 
262  public function offsetSet($id, $value)
263  {
267  #require_once 'Zend/Mail/Storage/Exception.php';
268  throw new Zend_Mail_Storage_Exception('cannot write mail messages via array access');
269  }
270 
271 
278  public function offsetUnset($id)
279  {
280  return $this->removeMessage($id);
281  }
282 
283 
293  public function rewind()
294  {
295  $this->_iterationMax = $this->countMessages();
296  $this->_iterationPos = 1;
297  }
298 
299 
305  public function current()
306  {
307  return $this->getMessage($this->_iterationPos);
308  }
309 
310 
316  public function key()
317  {
318  return $this->_iterationPos;
319  }
320 
321 
327  public function next()
328  {
330  }
331 
332 
338  public function valid()
339  {
340  if ($this->_iterationMax === null) {
341  $this->_iterationMax = $this->countMessages();
342  }
343  return $this->_iterationPos && $this->_iterationPos <= $this->_iterationMax;
344  }
345 
346 
354  public function seek($pos)
355  {
356  if ($this->_iterationMax === null) {
357  $this->_iterationMax = $this->countMessages();
358  }
359 
360  if ($pos > $this->_iterationMax) {
361  throw new OutOfBoundsException('this position does not exist');
362  }
363  $this->_iterationPos = $pos;
364  }
365 
366 }
$id
Definition: fieldset.phtml:14
$value
Definition: gender.phtml:16
$pos
Definition: list.phtml:42
getRawHeader($id, $part=null, $topLines=0)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition: website.php:18
getRawContent($id, $part=null)