message class specific operations moved to sub package

This commit is contained in:
Clivern 2017-08-12 15:40:47 +02:00
commit 48b63f0eb7
3 changed files with 132 additions and 0 deletions

39
src/Core/Message/Actions Normal file
View file

@ -0,0 +1,39 @@
<?php
/**
* @author clivern <hello@clivern.com>
*/
namespace Clivern\Imap\Core\Message;
use Clivern\Imap\Core\Connection;
/**
* Actions Class
*
* @package Clivern\Imap\Core\Message
*/
class Actions
{
/**
* @var Connection
*/
protected $connection;
/**
* @var integer
*/
protected $message_number;
/**
* @var integer
*/
protected $message_uid;
public function __construct(Connection $connection, $message_number, $message_uid)
{
$this->connection = $connection;
$this->message_number = $message_number;
$this->message_uid = $message_uid;
}
}

View file

@ -0,0 +1,16 @@
<?php
/**
* @author clivern <hello@clivern.com>
*/
namespace Clivern\Imap\Core\Message;
/**
* Attachment Class
*
* @package Clivern\Imap\Core\Message
*/
class Attachment
{
#~
}

View file

@ -0,0 +1,77 @@
<?php
/**
* @author clivern <hello@clivern.com>
*/
namespace Clivern\Imap\Core\Message;
use Clivern\Imap\Core\Connection;
/**
* Header Class
*
* @package Clivern\Imap\Core\Message
*/
class Header
{
/**
* @var Connection
*/
protected $connection;
/**
* @var integer
*/
protected $message_number;
/**
* @var array
*/
protected $header = [];
/**
* @var integer
*/
protected $message_uid;
public function __construct(Connection $connection, $message_number, $message_uid)
{
$this->connection = $connection;
$this->message_number = $message_number;
$this->message_uid = $message_uid;
}
/**
* Get From Header
*
* @param string $key
* @param boolean $default
* @return mixed
*/
public function get($key, $default = false)
{
return (isset($this->header[strtolower($key)])) ? $this->header[strtolower($key)] : $default;
}
/**
* Check if header has key
*
* @param string $key
* @return boolean
*/
public function has($key)
{
return (isset($this->header[strtolower($key)]));
}
/**
* Load Header Data
*
* @return boolean
*/
protected function load()
{
#~
}
}