当前位置: 首页>>代码示例>>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;未经允许,请勿转载。