plugins/libkolab

Aleksander Machniak machniak at kolabsys.com
Wed Jul 3 09:20:35 CEST 2013


 plugins/libkolab/lib/kolab_storage_folder.php |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit aea5e2009c842ec9436d94df4dfb16bd4bc0ca5c
Author: Aleksander Machniak <machniak at kolabsys.com>
Date:   Wed Jul 3 09:19:16 2013 +0200

    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.

diff --git a/plugins/libkolab/lib/kolab_storage_folder.php b/plugins/libkolab/lib/kolab_storage_folder.php
index 5809ebc..f046bbf 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;
     }





More information about the commits mailing list