*/ namespace Clivern\Imap\Core\Message; use Clivern\Imap\Core\Connection; /** * Action Class * * @package Clivern\Imap\Core\Message */ class Action { /** * @var Connection */ protected $connection; /** * @var integer */ protected $message_number; /** * @var integer */ protected $message_uid; /** * Class Constructor * * @param Connection $connection */ public function __construct(Connection $connection) { $this->connection = $connection; } /** * Config Message * * @param integer $message_number * @param integer $message_uid * @return Action */ public function config($message_number, $message_uid) { $this->message_number = $message_number; $this->message_uid = $message_uid; return $this; } /** * Delete Message * * @return boolean */ public function delete() { return (boolean) imap_delete($this->connection->getStream(), $this->message_uid, \FT_UID); } /** * Undelete Message * * @return boolean */ public function undelete() { return (boolean) imap_undelete($this->connection->getStream(), $this->message_uid, \FT_UID); } }