]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add simpler delete preference for Profile and User
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 21 Jan 2015 21:59:15 +0000 (22:59 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 21 Jan 2015 22:00:33 +0000 (23:00 +0100)
classes/Profile.php
classes/User.php

index 00a457a5c9c2062aa9163373fddb4bc170fe65e3..e850b629d41c28e2aaaf9ba823782ae263e1f9c0 100644 (file)
@@ -1565,6 +1565,10 @@ class Profile extends Managed_DataObject
         return $this->getUser()->shortenLinks($text, $always);
     }
 
+    public function delPref($namespace, $topic) {
+        return Profile_prefs::setData($this, $namespace, $topic, null);
+    }
+
     public function getPref($namespace, $topic, $default=null) {
         return Profile_prefs::getData($this, $namespace, $topic, $default);
     }
index bed702867b6b2823922f55562aadaebba99c4537..242873efe17ba908bb66aac9ac69710b86e68a5b 100644 (file)
@@ -1007,6 +1007,11 @@ class User extends Managed_DataObject
         return $act;
     }
 
+    public function delPref($namespace, $topic)
+    {
+        return $this->getProfile()->delPref($namespace, $topic);
+    }
+
     public function getPref($namespace, $topic, $default=null)
     {
         return $this->getProfile()->getPref($namespace, $topic, $default);