Code cleanup: define private members and default DB values; set kolab_format reference to new objects

This commit is contained in:
Thomas Bruederli 2012-05-16 14:16:29 +02:00
parent 5cc7fc616f
commit e379aaafc1
2 changed files with 5 additions and 2 deletions

View file

@ -29,6 +29,7 @@ class kolab_storage_cache
private $folder;
private $uid2msg;
private $objects;
private $index = array();
private $resource_uri;
private $enabled = true;
private $synched = false;
@ -422,7 +423,7 @@ class kolab_storage_cache
private function _serialize($object)
{
$bincols = array_flip($this->binary_cols);
$sql_data = array('dtstart' => null, 'dtend' => null, 'xml' => '');
$sql_data = array('dtstart' => null, 'dtend' => null, 'xml' => '', 'tags' => '', 'words' => '');
// set type specific values
if ($this->folder->type == 'event') {

View file

@ -271,7 +271,8 @@ class kolab_storage_folder
{
if (!$type) $type = $this->type;
// TODO: synchronize cache first?
// synchronize cache first
$this->cache->synchronize();
return $this->cache->count(array(array('type','=',$type)));
}
@ -625,6 +626,7 @@ class kolab_storage_folder
$format->set($object);
$xml = $format->write();
$object['uid'] = $format->uid; // get read UID from format
$object['_formatobj'] = $format;
if (!$format->is_valid() || empty($object['uid'])) {
return false;