Add type argument to get_object() - when you fetch object by uid

and it's type is different than folder type (e.g. distribution-list)
it need to be specified here.
This commit is contained in:
Aleksander Machniak 2013-07-03 09:19:16 +02:00
parent 2cbe93a0c9
commit aea5e2009c

View file

@ -412,17 +412,22 @@ class kolab_storage_folder
/**
* Getter for a single Kolab object, identified by its UID
*
* @param string Object UID
* @param string $uid Object UID
* @param string $type Object type (e.g. contact, event, todo, journal, note, configuration)
* Defaults to folder type
*
* @return array The Kolab object represented as hash array
*/
public function get_object($uid)
public function get_object($uid, $type = null)
{
// synchronize caches
$this->cache->synchronize();
$msguid = $this->cache->uid2msguid($uid);
if ($msguid && ($object = $this->cache->get($msguid, '*')))
if ($msguid && ($object = $this->cache->get($msguid, $type))) {
return $object;
}
return false;
}