]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
pkeyGet unfortunately returns null (should throw NoResultException) on empty result
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 6 Oct 2013 18:03:56 +0000 (20:03 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 6 Oct 2013 18:04:09 +0000 (20:04 +0200)
classes/Profile_prefs.php

index d7da8813e313dbdcf88228ca5879d2a5e772bdfc..7ad6233c5514a59c0015db77924526f6169815d9 100644 (file)
@@ -101,8 +101,12 @@ class Profile_prefs extends Managed_DataObject
     }
 
     static function getTopic(Profile $profile, $namespace, $topic) {
-        $pref = self::pkeyGet(array('profile_id'=>$profile->id, 'namespace'=>$namespace, 'topic'=>$topic));
-        if (is_null($pref)) {
+        $pref = new Profile_prefs;
+        $pref->profile_id = $profile->id;
+        $pref->namespace  = $namespace;
+        $pref->topic      = $topic;
+
+        if (!$pref->find(true)) {
             throw new NoResultException($pref);
         }
         return $pref;