snappymail/rainloop/v/0.0.0/app/libraries/MailSo/Mime/PartCollection.php
RainLoop Team 4cc2207513 Uploading and preparing the repository to the dev version.
Original unminified source code (dev folder - js, css, less) (fixes #6)
Grunt build system
Multiple identities correction (fixes #9)
Compose html editor (fixes #12)
New general settings - Loading Description
New warning about default admin password
Split general and login screen settings
2013-11-16 02:21:12 +04:00

56 lines
949 B
PHP

<?php
namespace MailSo\Mime;
/**
* @category MailSo
* @package Mime
*/
class PartCollection extends \MailSo\Base\Collection
{
/**
* @access protected
*/
protected function __construct()
{
parent::__construct();
}
/**
* @return \MailSo\Mime\PartCollection
*/
public static function NewInstance()
{
return new self();
}
/**
* @param string $sBoundary
*
* @return resorce
*/
public function ToStream($sBoundary)
{
$rResult = null;
if (0 < \strlen($sBoundary))
{
$aResult = array();
$aParts =& $this->GetAsArray();
foreach ($aParts as /* @var $oPart \MailSo\Mime\Part */ &$oPart)
{
if (0 < count($aResult))
{
$aResult[] = \MailSo\Mime\Enumerations\Constants::CRLF.
'--'.$sBoundary.\MailSo\Mime\Enumerations\Constants::CRLF;
}
$aResult[] = $oPart->ToStream();
}
return \MailSo\Base\StreamWrappers\SubStreams::CreateStream($aResult);
}
return $rResult;
}
}