Horde_Kolab_Storage_Data_Base::fetch PHP Метод

fetch() публичный Метод

Retrieves the objects for the given UIDs.
public fetch ( array $uids, boolean $raw = false ) : array
$uids array The message UIDs.
$raw boolean True if the raw format should be returned rather than the parsed data.
Результат array An array of objects.
    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;
    }