/** * @return Attachment[] */ public function getAttachments() { $this->driver->switchMailbox($this->mailbox->getName()); if ($this->attachments === NULL) { $this->attachments = array(); foreach ($this->attachmentsIds as $attachmentData) { $this->attachments[] = new Attachment($attachmentData['name'], $this->driver->getBody($this->id, array($attachmentData)), $attachmentData['type']); } } return $this->attachments; }
/** * Fetches mail ids from server */ protected function fetchMails() { $this->connection->getDriver()->switchMailbox($this->mailbox->getName()); $ids = $this->connection->getDriver()->getMailIds($this->filters, $this->limit, $this->offset, $this->orderBy, $this->orderType); $i = 0; $this->mails = array(); $this->iterator = 0; $this->mailIndexes = array(); foreach ($ids as $id) { $this->mails[$id] = new Mail($this->connection, $this->mailbox, $id); $this->mailIndexes[$i++] = $id; } }
protected function initializeFlags() { $this->connection->getDriver()->switchMailbox($this->mailbox->getName()); $this->flags = $this->connection->getDriver()->getFlags($this->id); }