From 5653c25641af541bc94dde7fa5d6fd8953c9efbb Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Wed, 21 Jan 2015 22:59:15 +0100 Subject: [PATCH] Add simpler delete preference for Profile and User --- classes/Profile.php | 4 ++++ classes/User.php | 5 +++++ 2 files changed, 9 insertions(+) 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); -- 2.39.5