當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Swift_Message::detach方法代碼示例

本文整理匯總了PHP中Swift_Message::detach方法的典型用法代碼示例。如果您正苦於以下問題:PHP Swift_Message::detach方法的具體用法?PHP Swift_Message::detach怎麽用?PHP Swift_Message::detach使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Swift_Message的用法示例。


在下文中一共展示了Swift_Message::detach方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: flushAttachments

 /**
  * Clear out all attachments
  * @return boolean
  */
 public function flushAttachments()
 {
     $success = true;
     foreach ($this->attachmentIds as $id) {
         try {
             $this->message->detach($id);
         } catch (Swift_Message_MimeException $e) {
             $success = false;
             $this->setError("An attachment failed to detach due to the error:<br />" . $e->getMessage());
         }
     }
     $this->attachmentIds = array();
     return $success;
 }
開發者ID:darkcolonist,項目名稱:kohana234-doctrine115,代碼行數:18,代碼來源:EasySwift.php

示例2: flushAttachments

 /**
  * Clear out all attachments
  * @return boolean
  */
 function flushAttachments()
 {
     $success = true;
     foreach ($this->attachmentIds as $id) {
         Swift_Errors::expect($e, "Swift_Message_MimeException");
         $this->message->detach($id);
         if ($e) {
             $success = false;
             $this->setError("An attachment failed to detach due to the error:<br />" . $e->getMessage());
         }
         $e = null;
         Swift_Errors::clear("Swift_Message_MimeException");
     }
     $this->attachmentIds = array();
     return $success;
 }
開發者ID:jeffthestampede,項目名稱:excelsior,代碼行數:20,代碼來源:EasySwift.php

示例3: testRemovingAllSubParts

 /**
  * Removing all subParts should give a multipart/mixed message with a nested multipart/related document.
  */
 public function testRemovingAllSubParts()
 {
     $msg = new Swift_Message();
     $id1 = $msg->attach(new Swift_Message_Attachment("bar"));
     $id2 = $msg->attach(new Swift_Message_EmbeddedFile("foo"));
     $id3 = $msg->attach(new Swift_Message_Part("test"));
     $msg->detach($id3);
     $structure = $msg->build()->readFull();
     //$this->dump($structure);
     $this->assertNoPattern("~Content-Type: multipart/alternative~", $structure);
     $this->assertPattern("~.*?Content-Type: multipart/mixed;\\s* boundary=(\"?)(.*?)\\1\r\n" . ".*?\r\n\r\n" . ".*?\r\n--\\2\r\n" . "Content-Type: multipart/related;\\s* boundary=(\"?)(.*?)\\3\r\n" . ".*?\r\n\r\n" . ".*?\r\n--\\4\r\n" . ".*?\r\n--\\4--" . "\\s*\r\n--\\2\r\n" . ".*?\r\n\r\n" . ".*?\r\n--\\2--~s", $structure);
 }
開發者ID:Esleelkartea,項目名稱:legedia-ESLE,代碼行數:15,代碼來源:TestOfMessage.php

示例4: detach

 /**
  * {@inheritdoc}
  *
  * @return $this|self
  */
 public function detach(\Swift_Mime_MimeEntity $entity) : self
 {
     $this->message->detach($entity);
     return $this;
 }
開發者ID:cawaphp,項目名稱:email,代碼行數:10,代碼來源:Message.php


注:本文中的Swift_Message::detach方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。