本文整理汇总了PHP中Horde_Mime_Part::partIterator方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde_Mime_Part::partIterator方法的具体用法?PHP Horde_Mime_Part::partIterator怎么用?PHP Horde_Mime_Part::partIterator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Horde_Mime_Part
的用法示例。
在下文中一共展示了Horde_Mime_Part::partIterator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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: matchStructure
/**
*/
public function matchStructure(Horde_Mime_Part $data)
{
foreach ($data->partIterator() as $val) {
if (IMP_Mime_Attachment::isAttachment($val)) {
return true;
}
}
return false;
}
示例3: downloadAllList
/**
* 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;
}