コード例 #1
0
ファイル: Part.php プロジェクト: karnurik/zf2-turtorial
 /**
  * Access headers collection
  *
  * Lazy-loads if not already attached.
  *
  * @return Headers
  */
 public function getHeaders()
 {
     if (null === $this->headers) {
         if ($this->mail) {
             $part = $this->mail->getRawHeader($this->messageNum);
             $this->headers = Headers::fromString($part);
         } else {
             $this->headers = new Headers();
         }
     }
     return $this->headers;
 }
コード例 #2
0
ファイル: Part.php プロジェクト: bradley-holt/zf2
 /**
  * Get all headers
  *
  * The returned headers are as saved internally. All names are lowercased. The value is a string or an array
  * if a header with the same name occurs more than once.
  *
  * @return array headers as array(name => value)
  */
 public function getHeaders()
 {
     if ($this->_headers === null) {
         if (!$this->_mail) {
             $this->_headers = array();
         } else {
             $part = $this->_mail->getRawHeader($this->_messageNum);
             $body = null;
             // "Declare" variable since it's passed by reference
             Mime\Decode::splitMessage($part, $this->_headers, $body);
         }
     }
     return $this->_headers;
 }