public function create()
{
if (isset($this->_params['storage'])) {
$sparams = $this->_params['storage'];
} else {
$sparams = array();
}
if (isset($this->_params['queries'])) {
$sparams['queries'] = $this->_params['queries'];
}
if (isset($this->_params['queryset'])) {
$queryset = $this->_params['queryset'];
$sparams['queryset'] = $this->_params['queryset'];
} else {
$queryset = array();
}
$cache = $this->createCache();
if (!empty($this->_params['cache'])) {
$storage = new Horde_Kolab_Storage_Cached($this->createDriver(), new Horde_Kolab_Storage_QuerySet_Cached($this, $queryset, $cache), $this, $cache, $this->_params['logger'], $sparams);
} else {
$storage = new Horde_Kolab_Storage_Uncached($this->createDriver(), new Horde_Kolab_Storage_QuerySet_Uncached($this, $queryset), $this, $cache, $this->_params['logger'], $sparams);
}
if (empty($this->_params['sync_strategy'])) {
$strategy = new Horde_Kolab_Storage_Synchronization_OncePerSession();
} else {
$strategy = $this->_params['sync_strategy'];
}
$storage = new Horde_Kolab_Storage_Decorator_Synchronization($storage, new Horde_Kolab_Storage_Synchronization($strategy));
return $storage;
}