Horde_ActiveSync_Imap_Adapter::_getMailMessages PHP Method

_getMailMessages() protected method

protected _getMailMessages ( Horde_Imap_Client_Mailbox $mbox, array $uids, array $options = [] ) : Horde_Imap_Fetch_Results
$mbox Horde_Imap_Client_Mailbox The mailbox
$uids array An array of message uids
$options array An options array - headers: (boolean) Fetch header text if true. DEFAULT: false (Do not fetch header text). - structure: (boolean) Fetch message structure. DEFAULT: true (Fetch message structure). - flags: (boolean) Fetch messagge flags. DEFAULT: true (Fetch message flags). - envelope: (boolen) Fetch the envelope data. DEFAULT: false (Do not fetch envelope). @since 2.4.0
return Horde_Imap_Fetch_Results The results.
    protected function _getMailMessages(Horde_Imap_Client_Mailbox $mbox, array $uids, array $options = array())
    {
        $options = array_merge(array('headers' => false, 'structure' => true, 'flags' => true, 'envelope' => false), $options);
        $query = new Horde_Imap_Client_Fetch_Query();
        if ($options['structure']) {
            $query->structure();
        }
        if ($options['flags']) {
            $query->flags();
        }
        if ($options['envelope']) {
            $query->envelope();
        }
        if (!empty($options['headers'])) {
            $query->headerText(array('peek' => true));
        }
        try {
            return $this->_getImapOb()->fetch($mbox, $query, array('ids' => new Horde_Imap_Client_Ids($uids), 'exists' => true));
        } catch (Horde_Imap_Client_Exception $e) {
            $this->_logger->err(sprintf('[%s] Unable to fetch message: %s', $this->_procid, $e->getMessage()));
            throw new Horde_ActiveSync_Exception($e);
        }
    }