]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Shortcut to Profile_prefs get/set Data in Profile and User
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 13 Jul 2014 14:30:37 +0000 (16:30 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 13 Jul 2014 14:49:35 +0000 (16:49 +0200)
classes/Profile.php
classes/User.php

index e5d00b392d88811c7c5932a59ff6b10403568ab3..e0eb06956feae9f3fcceea150e609d6040eac599 100644 (file)
@@ -1570,4 +1570,12 @@ class Profile extends Managed_DataObject
     {
         return $this->getUser()->shortenLinks($text, $always);
     }
+
+    public function getPref($namespace, $topic, $default=null) {
+        return Profile_prefs::getData($this, $namespace, $topic, $default);
+    }
+
+    public function setPref($namespace, $topic, $data) {
+        return Profile_prefs::setData($this, $namespace, $topic, $data);
+    }
 }
index 1c54affda7461730b6553bfd41fd21cfffe9ab10..b55b57c181c6558d567fb8f07fe4e29217cc3182 100644 (file)
@@ -1007,4 +1007,14 @@ class User extends Managed_DataObject
                                 $service->title);
         return $act;
     }
+
+    public function getPref($namespace, $topic, $default=null)
+    {
+        return $this->getProfile()->getPref($namespace, $topic, $default);
+    }
+
+    public function setPref($namespace, $topic, $data)
+    {
+        return $this->getProfile()->setPref($namespace, $topic, $data);
+    }
 }