Add simpler delete preference for Profile and User

This commit is contained in:
Mikael Nordfeldth 2015-01-21 22:59:15 +01:00
parent 8d7230a2b9
commit 5653c25641
2 changed files with 9 additions and 0 deletions

View 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);
}

View 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);