/** * Retrieves the objects for the given UIDs. * * @param array $uids The message UIDs. * @param boolean $raw True if the raw format should be returned rather than * the parsed data. * * @return array An array of objects. * @throws new Horde_Kolab_Storage_Exception */ public function fetch($uids, $raw = false) { if (empty($uids)) { return array(); } if ($raw === false) { $writer = new Horde_Kolab_Storage_Object_Writer_Format(new Horde_Kolab_Format_Factory(), array('version' => $this->_version)); } else { $writer = new Horde_Kolab_Storage_Object_Writer_Raw(); } $objects = array(); $structures = $this->_driver->fetchStructure($this->_folder->getPath(), $uids); foreach ($structures as $uid => $structure) { if (!isset($structure['structure'])) { throw new Horde_Kolab_Storage_Exception('Backend returned a structure without the expected "structure" element.'); } $object = new Horde_Kolab_Storage_Object(); $object->setDriver($this->_driver); $object->load($uid, $this->_folder, $writer, $structure['structure']); $objects[$uid] = $object; } return $objects; }
/** * Retrieves the messages for the given message ids. * * @param string $folder The folder to fetch the messages from. * @param array $uids The message UIDs. * * @return array An array of message structures parsed into Horde_Mime_Part * instances. */ public function fetchStructure($folder, $uids) { return $this->_driver->fetchStructure($folder, $uids); }