/** * ImapMessageFactory constructor. * @param $messageNum * @param $imap * @param $peek * @param $excludeBody * @param Decoder|null $decoder * @param $outputEncoding */ protected function __construct($messageNum, Imap $imap, $peek, $excludeBody, Decoder $decoder = null, $outputEncoding) { $this->imap = $imap; $this->messageNum = $messageNum; $this->decoder = !$decoder ? new MessageDecoder() : $decoder; $this->outputEncoding = $outputEncoding; $this->structure = $imap->fetchStructure($messageNum); $this->headers = (array) $imap->getMessageHeaders($messageNum); $this->message = new ImapMessage(); $this->message->setStructure($this->structure); $this->message->setHeaders($this->headers); $this->bodyParts = $this->flattenBodyParts($this->structure); $this->message->setBodyParts($this->bodyParts); if (!$excludeBody) { $options = $peek ? FT_PEEK : 0; $this->setMessageBody($options); } $this->setMessageHeaders(); }
function __construct(MessageCache $cache, Imap $imap) { $this->cache = $cache; $this->imap = $imap; $this->folder = $imap->getConnection()->getMailbox()->getFolder(); }