Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Zend_Mail_Storage_Abstract Class Reference
Inheritance diagram for Zend_Mail_Storage_Abstract:
Zend_Mail_Storage_Imap Zend_Mail_Storage_Maildir Zend_Mail_Storage_Mbox Zend_Mail_Storage_Pop3 Zend_Mail_Storage_Folder_Maildir Zend_Mail_Storage_Folder_Mbox Zend_Mail_Storage_Writable_Maildir

Public Member Functions

 __get ($var)
 
 getCapabilities ()
 
 countMessages ()
 
 getSize ($id=0)
 
 getMessage ($id)
 
 getRawHeader ($id, $part=null, $topLines=0)
 
 getRawContent ($id, $part=null)
 
 __construct ($params)
 
 __destruct ()
 
 close ()
 
 noop ()
 
 removeMessage ($id)
 
 getUniqueId ($id=null)
 
 getNumberByUniqueId ($id)
 
 count ()
 
 offsetExists ($id)
 
 offsetGet ($id)
 
 offsetSet ($id, $value)
 
 offsetUnset ($id)
 
 rewind ()
 
 current ()
 
 key ()
 
 next ()
 
 valid ()
 
 seek ($pos)
 

Protected Attributes

 $_has
 
 $_iterationPos = 0
 
 $_iterationMax = null
 
 $_messageClass = 'Zend_Mail_Message'
 

Detailed Description

Definition at line 31 of file Abstract.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $params)
abstract

Create instance with parameters

Parameters
array$paramsmail reader specific parameters
Exceptions
Zend_Mail_Storage_Exception

◆ __destruct()

__destruct ( )

Destructor calls close() and therefore closes the resource.

Definition at line 159 of file Abstract.php.

160  {
161  $this->close();
162  }

Member Function Documentation

◆ __get()

__get (   $var)

Getter for has-properties. The standard has properties are: hasFolder, hasUniqueid, hasDelete, hasCreate, hasTop

The valid values for the has-properties are:

  • true if a feature is supported
  • false if a feature is not supported
  • null is it's not yet known or it can't be know if a feature is supported
Parameters
string$varproperty name
Returns
bool supported or not
Exceptions
Zend_Mail_Storage_Exception
See also
Zend_Mail_Storage_Exception

Definition at line 75 of file Abstract.php.

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  }

◆ close()

close ( )
abstract

Close resource for mail lib. If you need to control, when the resource is closed. Otherwise the destructor would call this.

Returns
null

◆ count()

count ( )

Countable::count()

Returns
int

Definition at line 218 of file Abstract.php.

219  {
220  return $this->countMessages();
221  }

◆ countMessages()

countMessages ( )
abstract

Count messages messages in current box/folder

Returns
int number of messages
Exceptions
Zend_Mail_Storage_Exception

◆ current()

current ( )

Iterator::current()

Returns
Zend_Mail_Message current message

Definition at line 305 of file Abstract.php.

306  {
307  return $this->getMessage($this->_iterationPos);
308  }

◆ getCapabilities()

getCapabilities ( )

Get a full list of features supported by the specific mail lib and the server

Returns
array list of features as array(featurename => true|false[|null])

Definition at line 95 of file Abstract.php.

96  {
97  return $this->_has;
98  }

◆ getMessage()

getMessage (   $id)
abstract

Get a message with headers and body

Parameters
int$idnumber of message
Returns
Zend_Mail_Message

◆ getNumberByUniqueId()

getNumberByUniqueId (   $id)
abstract

get a message number from a unique id

I.e. if you have a webmailer that supports deleting messages you should use unique ids as parameter and use this method to translate it to message number right before calling removeMessage()

Parameters
string$idunique id
Returns
int message number
Exceptions
Zend_Mail_Storage_Exception

◆ getRawContent()

getRawContent (   $id,
  $part = null 
)
abstract

Get raw content of message or part

Parameters
int$idnumber of message
null | array | string$partpath to part or null for messsage content
Returns
string raw content

◆ getRawHeader()

getRawHeader (   $id,
  $part = null,
  $topLines = 0 
)
abstract

Get raw header of message or part

Parameters
int$idnumber of message
null | array | string$partpath to part or null for messsage header
int$topLinesinclude this many lines with header (after an empty line)
Returns
string raw header

◆ getSize()

getSize (   $id = 0)
abstract

Get a list of messages with number and size

Parameters
int$idnumber of message
Returns
int|array size of given message of list with all messages as array(num => size)

◆ getUniqueId()

getUniqueId (   $id = null)
abstract

get unique id for one or all messages

if storage does not support unique ids it's the same as the message number

Parameters
int | null$idmessage number
Returns
array|string message number for given message or all messages as array
Exceptions
Zend_Mail_Storage_Exception

◆ key()

key ( )

Iterator::key()

Returns
int id of current position

Definition at line 316 of file Abstract.php.

317  {
318  return $this->_iterationPos;
319  }

◆ next()

next ( )

Iterator::next()

Returns
void

Definition at line 327 of file Abstract.php.

328  {
330  }

◆ noop()

noop ( )
abstract

Keep the resource alive.

Returns
null

◆ offsetExists()

offsetExists (   $id)

ArrayAccess::offsetExists()

Parameters
int$id
Returns
boolean

Definition at line 230 of file Abstract.php.

231  {
232  try {
233  if ($this->getMessage($id)) {
234  return true;
235  }
236  } catch(Zend_Mail_Storage_Exception $e) {}
237 
238  return false;
239  }
$id
Definition: fieldset.phtml:14

◆ offsetGet()

offsetGet (   $id)

ArrayAccess::offsetGet()

Parameters
int$id
Returns
Zend_Mail_Message message object

Definition at line 248 of file Abstract.php.

249  {
250  return $this->getMessage($id);
251  }
$id
Definition: fieldset.phtml:14

◆ offsetSet()

offsetSet (   $id,
  $value 
)

ArrayAccess::offsetSet()

Parameters
id$id
mixed$value
Exceptions
Zend_Mail_Storage_Exception
Returns
void
See also
Zend_Mail_Storage_Exception

Definition at line 262 of file Abstract.php.

263  {
267  #require_once 'Zend/Mail/Storage/Exception.php';
268  throw new Zend_Mail_Storage_Exception('cannot write mail messages via array access');
269  }

◆ offsetUnset()

offsetUnset (   $id)

ArrayAccess::offsetUnset()

Parameters
int$id
Returns
boolean success

Definition at line 278 of file Abstract.php.

279  {
280  return $this->removeMessage($id);
281  }
$id
Definition: fieldset.phtml:14

◆ removeMessage()

removeMessage (   $id)
abstract

delete a message from current box/folder

Returns
null

◆ rewind()

rewind ( )

Iterator::rewind()

Rewind always gets the new count from the storage. Thus if you use the interfaces and your scripts take long you should use reset() from time to time.

Returns
void

Definition at line 293 of file Abstract.php.

294  {
295  $this->_iterationMax = $this->countMessages();
296  $this->_iterationPos = 1;
297  }

◆ seek()

seek (   $pos)

SeekableIterator::seek()

Parameters
int$pos
Returns
void
Exceptions
OutOfBoundsException

Definition at line 354 of file Abstract.php.

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  }
$pos
Definition: list.phtml:42

◆ valid()

valid ( )

Iterator::valid()

Returns
boolean

Definition at line 338 of file Abstract.php.

339  {
340  if ($this->_iterationMax === null) {
341  $this->_iterationMax = $this->countMessages();
342  }
343  return $this->_iterationPos && $this->_iterationPos <= $this->_iterationMax;
344  }

Field Documentation

◆ $_has

$_has
protected
Initial value:
= array('uniqueid' => true,
'delete' => false,
'create' => false,
'top' => false,
'fetchPart' => true,
'flags' => false)

Definition at line 37 of file Abstract.php.

◆ $_iterationMax

$_iterationMax = null
protected

Definition at line 54 of file Abstract.php.

◆ $_iterationPos

$_iterationPos = 0
protected

Definition at line 48 of file Abstract.php.

◆ $_messageClass

$_messageClass = 'Zend_Mail_Message'
protected

Definition at line 60 of file Abstract.php.


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