Code cleanup: define private members and default DB values; set kolab_format reference to new objects
This commit is contained in:
parent
5cc7fc616f
commit
e379aaafc1
2 changed files with 5 additions and 2 deletions
|
@ -29,6 +29,7 @@ class kolab_storage_cache
|
||||||
private $folder;
|
private $folder;
|
||||||
private $uid2msg;
|
private $uid2msg;
|
||||||
private $objects;
|
private $objects;
|
||||||
|
private $index = array();
|
||||||
private $resource_uri;
|
private $resource_uri;
|
||||||
private $enabled = true;
|
private $enabled = true;
|
||||||
private $synched = false;
|
private $synched = false;
|
||||||
|
@ -422,7 +423,7 @@ class kolab_storage_cache
|
||||||
private function _serialize($object)
|
private function _serialize($object)
|
||||||
{
|
{
|
||||||
$bincols = array_flip($this->binary_cols);
|
$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
|
// set type specific values
|
||||||
if ($this->folder->type == 'event') {
|
if ($this->folder->type == 'event') {
|
||||||
|
|
|
@ -271,7 +271,8 @@ class kolab_storage_folder
|
||||||
{
|
{
|
||||||
if (!$type) $type = $this->type;
|
if (!$type) $type = $this->type;
|
||||||
|
|
||||||
// TODO: synchronize cache first?
|
// synchronize cache first
|
||||||
|
$this->cache->synchronize();
|
||||||
|
|
||||||
return $this->cache->count(array(array('type','=',$type)));
|
return $this->cache->count(array(array('type','=',$type)));
|
||||||
}
|
}
|
||||||
|
@ -625,6 +626,7 @@ class kolab_storage_folder
|
||||||
$format->set($object);
|
$format->set($object);
|
||||||
$xml = $format->write();
|
$xml = $format->write();
|
||||||
$object['uid'] = $format->uid; // get read UID from format
|
$object['uid'] = $format->uid; // get read UID from format
|
||||||
|
$object['_formatobj'] = $format;
|
||||||
|
|
||||||
if (!$format->is_valid() || empty($object['uid'])) {
|
if (!$format->is_valid() || empty($object['uid'])) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue