Provide static fuction to query for objects address kolab groupware folders
This commit is contained in:
parent
49f9771ed4
commit
e25fd88b73
1 changed files with 27 additions and 0 deletions
|
@ -177,6 +177,33 @@ class kolab_storage
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute cross-folder searches with the given query.
|
||||
*
|
||||
* @param array Pseudo-SQL query as list of filter parameter triplets
|
||||
* @param string Object type (contact,event,task,journal,file,note,configuration)
|
||||
* @return array List of Kolab data objects (each represented as hash array)
|
||||
* @see kolab_storage_format::select()
|
||||
*/
|
||||
public static function select($query, $type)
|
||||
{
|
||||
self::setup();
|
||||
$folder = null;
|
||||
$result = array();
|
||||
|
||||
foreach ((array)self::list_folders('', '*', $type) as $foldername) {
|
||||
if (!$folder)
|
||||
$folder = new kolab_storage_folder($foldername);
|
||||
else
|
||||
$folder->set_folder($foldername);
|
||||
|
||||
foreach ($folder->select($query, '*') as $object) {
|
||||
$result[] = $object;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue