mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
65 lines
1.1 KiB
PHP
65 lines
1.1 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of MailSo.
|
|
*
|
|
* (c) 2014 Usenko Timur
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace MailSo\Mime;
|
|
|
|
/**
|
|
* @category MailSo
|
|
* @package Mime
|
|
*/
|
|
class AttachmentCollection extends \MailSo\Base\Collection
|
|
{
|
|
protected function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
public static function NewInstance() : self
|
|
{
|
|
return new self();
|
|
}
|
|
|
|
public function append(Attachment $oFolder, bool $bToTop = false) : void
|
|
{
|
|
parent::append($oFolder, $bToTop);
|
|
}
|
|
|
|
public function LinkedAttachments() : array
|
|
{
|
|
$aResult = array();
|
|
foreach ($this as $oAttachment) {
|
|
if ($oAttachment->IsLinked()) {
|
|
$aResult[] = $oAttachment;
|
|
}
|
|
}
|
|
return $aResult;
|
|
}
|
|
|
|
public function UnlinkedAttachments() : array
|
|
{
|
|
$aResult = array();
|
|
foreach ($this as $oAttachment) {
|
|
if (!$oAttachment->IsLinked()) {
|
|
$aResult[] = $oAttachment;
|
|
}
|
|
}
|
|
return $aResult;
|
|
}
|
|
|
|
public function SizeOfAttachments() : int
|
|
{
|
|
$iResult = 0;
|
|
foreach ($this as $oAttachment) {
|
|
$iResult += $oAttachment->FileSize();
|
|
}
|
|
return $iResult;
|
|
}
|
|
}
|