/** * Retrieve a handler for the data in this folder. * * @param Kolab_List $list The handler for the list of folders. * * @return Horde_Kolab_Storage_Data The data handler. */ public function getData($object_type = null, $data_version = 1) { if (empty($object_type)) { $object_type = $this->getType(); if (is_a($object_type, 'PEAR_Error')) { return $object_type; } } if ($this->tainted) { foreach ($this->_data as $data) { $data->synchronize(); } $this->tainted = false; } $key = $object_type . '|' . $data_version; if (!isset($this->_data[$key])) { if ($object_type != 'annotation') { $type = $this->getType(); } else { $type = 'annotation'; } $data = new Horde_Kolab_Storage_Data($type, $object_type, $data_version); $data->setFolder($this); $data->setCache($this->_storage->getDataCache()); $data->synchronize(); $this->_data[$key] =& $data; } return $this->_data[$key]; }