From aea5e2009c842ec9436d94df4dfb16bd4bc0ca5c Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 3 Jul 2013 09:19:16 +0200 Subject: [PATCH] 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. --- plugins/libkolab/lib/kolab_storage_folder.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/libkolab/lib/kolab_storage_folder.php b/plugins/libkolab/lib/kolab_storage_folder.php index 5809ebc6..f046bbf5 100644 --- a/plugins/libkolab/lib/kolab_storage_folder.php +++ b/plugins/libkolab/lib/kolab_storage_folder.php @@ -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; }