Horde_ActiveSync_Imap_Adapter::getUidFromMidInFolders PHP Method

getUidFromMidInFolders() public method

Attempt to find a Message-ID in a list of mail folders.
Deprecation: This is unused and should be removed.
public getUidFromMidInFolders ( $id, array $folders ) : array
$folders array
return array An array with the 0 element being the mbox
    public function getUidFromMidInFolders($id, array $folders)
    {
        $search_q = new Horde_Imap_Client_Search_Query();
        $search_q->headerText('Message-ID', $id);
        foreach ($folders as $folder) {
            $mbox = new Horde_Imap_Client_Mailbox($folder->_serverid);
            try {
                $results = $this->_getImapOb()->search($mbox, $search_q);
            } catch (Horde_Imap_Client_Exception $e) {
                throw new Horde_ActiveSync_Exception($e->getMessage());
            }
            $uid = $results['match']->ids;
            if (!empty($uid)) {
                return array($mbox, current($uid));
            }
        }
        throw new Horde_Exception_NotFound('Message not found.');
    }