Shortcut to Profile_prefs get/set Data in Profile and User

This commit is contained in:
Mikael Nordfeldth 2014-07-13 16:30:37 +02:00
parent b67a611ca7
commit b5fd2a048f
2 changed files with 18 additions and 0 deletions

View File

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

View File

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