From: Mikael Nordfeldth Date: Wed, 21 Jan 2015 21:59:15 +0000 (+0100) Subject: Add simpler delete preference for Profile and User X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5653c25641af541bc94dde7fa5d6fd8953c9efbb;p=quix0rs-gnu-social.git Add simpler delete preference for Profile and User --- diff --git a/classes/Profile.php b/classes/Profile.php index 00a457a5c9..e850b629d4 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -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); } diff --git a/classes/User.php b/classes/User.php index bed702867b..242873efe1 100644 --- a/classes/User.php +++ b/classes/User.php @@ -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);