partIterator() 공개 메소드

Returns the recursive iterator needed to iterate through this part.
부터: 2.8.0
public partIterator ( boolean $current = true ) : Iterator
$current boolean Include the current part as the base?
리턴 Iterator Recursive iterator.
예제 #1
0
파일: Related.php 프로젝트: x59/horde-mime
 /**
  * Constructor.
  *
  * @param Horde_Mime_Part $mime_part  A MIME part object. Must be of
  *                                    type multipart/related.
  */
 public function __construct(Horde_Mime_Part $mime_part)
 {
     if ($mime_part->getType() != 'multipart/related') {
         throw new InvalidArgumentException('MIME part must be of type multipart/related');
     }
     $id = null;
     $ids = array();
     $related_id = $mime_part->getMimeId();
     /* Build a list of parts -> CIDs. */
     foreach ($mime_part->partIterator() as $val) {
         $part_id = $val->getMimeId();
         $ids[] = $part_id;
         if (strcmp($related_id, $part_id) !== 0 && ($cid = $val->getContentId())) {
             $this->_cids[$part_id] = $cid;
         }
     }
     /* Look at the 'start' parameter to determine which part to start
      * with. If no 'start' parameter, use the first part (RFC 2387
      * [3.1]). */
     if ($start = $mime_part->getContentTypeParameter('start')) {
         $id = $this->cidSearch(trim($start, '<> '));
     }
     if (empty($id)) {
         reset($ids);
         $id = next($ids);
     }
     $this->_start = $id;
 }
예제 #2
0
 /**
  */
 public function matchStructure(Horde_Mime_Part $data)
 {
     foreach ($data->partIterator() as $val) {
         if (IMP_Mime_Attachment::isAttachment($val)) {
             return true;
         }
     }
     return false;
 }
예제 #3
0
파일: Contents.php 프로젝트: horde/horde
 /**
  * Get download all list.
  *
  * @return array  An array of downloadable parts.
  */
 public function downloadAllList()
 {
     $ret = array();
     $this->_buildMessage();
     foreach ($this->_message->partIterator() as $val) {
         if ($val->isAttachment()) {
             $ret[] = $val->getMimeId();
         }
     }
     return $ret;
 }