From: Mikael Nordfeldth Date: Sun, 13 Jul 2014 14:30:37 +0000 (+0200) Subject: Shortcut to Profile_prefs get/set Data in Profile and User X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b5fd2a048fc621ea05d756caba17275ab3dd0af4;p=quix0rs-gnu-social.git Shortcut to Profile_prefs get/set Data in Profile and User --- diff --git a/classes/Profile.php b/classes/Profile.php index e5d00b392d..e0eb06956f 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -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); + } } diff --git a/classes/User.php b/classes/User.php index 1c54affda7..b55b57c181 100644 --- a/classes/User.php +++ b/classes/User.php @@ -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); + } }