Initial xentral_oss_20.3.c9ffacf
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\MailClient\Data;
|
||||
|
||||
final class MailBoxInfoData
|
||||
{
|
||||
/** @var int $messages */
|
||||
private $messages;
|
||||
|
||||
/** @var int $recent */
|
||||
private $recent;
|
||||
|
||||
/** @var int $uidvalidity */
|
||||
private $uidvalidity;
|
||||
|
||||
/** @var array $flags */
|
||||
private $flags;
|
||||
|
||||
/**
|
||||
* @param int $messages
|
||||
* @param int $recent
|
||||
* @param int $uidvalidity
|
||||
* @param array $flags
|
||||
*/
|
||||
public function __construct(
|
||||
int $messages,
|
||||
int $recent,
|
||||
int $uidvalidity,
|
||||
array $flags = []
|
||||
)
|
||||
{
|
||||
$this->messages = $messages;
|
||||
$this->recent = $recent;
|
||||
$this->uidvalidity = $uidvalidity;
|
||||
$this->flags = $flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int total amount of messages
|
||||
*/
|
||||
public function getMessages(): int
|
||||
{
|
||||
return $this->messages;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int amount of recent messages
|
||||
*/
|
||||
public function getRecentMessages(): int
|
||||
{
|
||||
return $this->recent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getUidvalidity(): int
|
||||
{
|
||||
return $this->uidvalidity;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getFlags(): array
|
||||
{
|
||||
return $this->flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $flag
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasFlag(string $flag): bool
|
||||
{
|
||||
return array_key_exists($flag, $this->flags);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user