Merge branch 'profile-prefs-getall' into 'nightly'

Fixup Profile_prefs::getAll() 

Ref. #98 

See merge request !69
This commit is contained in:
mmn 2015-12-23 21:03:55 +00:00
commit 4904c2bc10

View File

@ -85,17 +85,17 @@ class Profile_prefs extends Managed_DataObject
static function getAll(Profile $profile) static function getAll(Profile $profile)
{ {
try { try {
$prefs = self::listFind('profile_id', $profile->getID()); $prefs = self::listFind('profile_id', array($profile->getID()));
} catch (NoResultException $e) { } catch (NoResultException $e) {
return array(); return array();
} }
$list = array(); $list = array();
while ($entry = $prefs->fetch()) { while ($prefs->fetch()) {
if (!isset($list[$entry->namespace])) { if (!isset($list[$prefs->namespace])) {
$list[$entry->namespace] = array(); $list[$prefs->namespace] = array();
} }
$list[$entry->namespace][$entry->topic] = $entry->data; $list[$prefs->namespace][$prefs->topic] = $prefs->data;
} }
return $list; return $list;
} }