Commit 5653c256 authored by mmn's avatar mmn

Add simpler delete preference for Profile and User

parent 8d7230a2
......@@ -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);
}
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment