Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Zend_Mail_Message Class Reference
Inheritance diagram for Zend_Mail_Message:
Zend_Mail_Part Zend_Mail_Message_Interface Zend_Mail_Part_Interface

Public Member Functions

 __construct (array $params)
 
 getTopLines ()
 
 hasFlag ($flag)
 
 getFlags ()
 
- Public Member Functions inherited from Zend_Mail_Part
 __construct (array $params)
 
 setPartClass ($class)
 
 getPartClass ()
 
 isMultipart ()
 
 getContent ()
 
 getSize ()
 
 getPart ($num)
 
 countParts ()
 
 getHeaders ()
 
 getHeader ($name, $format=null)
 
 headerExists ($name)
 
 getHeaderField ($name, $wantedPart=0, $firstName=0)
 
 __get ($name)
 
 __isset ($name)
 
 __toString ()
 
 hasChildren ()
 
 getChildren ()
 
 valid ()
 
 next ()
 
 key ()
 
 current ()
 
 rewind ()
 

Protected Attributes

 $_flags = array()
 
- Protected Attributes inherited from Zend_Mail_Part
 $_headers
 
 $_content
 
 $_topLines = ''
 
 $_parts = array()
 
 $_countParts
 
 $_iterationPos = 1
 
 $_mail
 
 $_messageNum = 0
 
 $_partClass
 

Additional Inherited Members

- Protected Member Functions inherited from Zend_Mail_Part
 _cacheContent ()
 
 _validateHeaders (array $headers, $assertNames=true)
 

Detailed Description

Definition at line 39 of file Message.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( array  $params)

Public constructor

In addition to the parameters of Zend_Mail_Part::__construct() this constructor supports:

  • file filename or file handle of a file with raw message content
  • flags array with flags for message, keys are ignored, use constants defined in Zend_Mail_Storage
Parameters
string$rawMessagefull message with or without headers
Exceptions
Zend_Mail_Exception
See also
Zend_Mail_Exception

Definition at line 57 of file Message.php.

58  {
59  if (isset($params['file'])) {
60  if (!is_resource($params['file'])) {
61  $params['raw'] = @file_get_contents($params['file']);
62  if ($params['raw'] === false) {
66  #require_once 'Zend/Mail/Exception.php';
67  throw new Zend_Mail_Exception('could not open file');
68  }
69  } else {
70  $params['raw'] = stream_get_contents($params['file']);
71  }
72  $params['raw'] = preg_replace("/(?<!\r)\n/", "\r\n", $params['raw']);
73  }
74 
75  if (!empty($params['flags'])) {
76  // set key and value to the same value for easy lookup
77  $this->_flags = array_merge($this->_flags, array_combine($params['flags'],$params['flags']));
78  }
79 
80  parent::__construct($params);
81  }
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition: website.php:18

Member Function Documentation

◆ getFlags()

getFlags ( )

get all set flags

Returns
array array with flags, key and value are the same for easy lookup

Implements Zend_Mail_Message_Interface.

Definition at line 109 of file Message.php.

110  {
111  return $this->_flags;
112  }

◆ getTopLines()

getTopLines ( )

return toplines as found after headers

Returns
string toplines

Implements Zend_Mail_Message_Interface.

Definition at line 88 of file Message.php.

89  {
90  return $this->_topLines;
91  }

◆ hasFlag()

hasFlag (   $flag)

check if flag is set

Parameters
mixed$flaga flag name, use constants defined in Zend_Mail_Storage
Returns
bool true if set, otherwise false

Implements Zend_Mail_Message_Interface.

Definition at line 99 of file Message.php.

100  {
101  return isset($this->_flags[$flag]);
102  }

Field Documentation

◆ $_flags

$_flags = array()
protected

Definition at line 45 of file Message.php.


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