Support array in 2nd argument of search() when searching by primary key, as in rcube_contacts class

This commit is contained in:
Aleksander Machniak 2011-06-13 15:53:16 +02:00
parent f408cb1c64
commit 937ff46230

View file

@ -251,7 +251,16 @@ class rcube_kolab_contacts extends rcube_addressbook
// search by ID
if ($fields == $this->primary_key) {
return $this->get_record($value);
$ids = !is_array($value) ? explode(',', $value) : $value;
$result = new rcube_result_set();
foreach ($ids as $id) {
if ($rec = $this->get_record($id, true)) {
$result->add($rec);
$result->count++;
}
}
return $result;
}
else if ($fields == '*') {
$fields = array_keys($this->coltypes);