renaming getPreferences method to loadPreferences to indicate you are
not "get"ing anythingpull/92/merge
parent
c58a91fc3b
commit
87dea7f6d0
|
@ -445,7 +445,7 @@ class User {
|
||||||
* read current user preferences from the database
|
* read current user preferences from the database
|
||||||
* @return boolean return false is user not connected
|
* @return boolean return false is user not connected
|
||||||
*/
|
*/
|
||||||
private function getPreferences() {
|
protected function loadPreferences() {
|
||||||
if($this->user_preferences === null) {
|
if($this->user_preferences === null) {
|
||||||
if(!$this->getUser()) {
|
if(!$this->getUser()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -466,7 +466,7 @@ class User {
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function getUserPref($key, $default = '') {
|
public function getUserPref($key, $default = '') {
|
||||||
if(!$this->getPreferences() || !isset($this->user_preferences[$key])) {
|
if(!$this->loadPreferences() || !isset($this->user_preferences[$key])) {
|
||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -481,7 +481,7 @@ class User {
|
||||||
* @param mixed $value
|
* @param mixed $value
|
||||||
*/
|
*/
|
||||||
public function setUserPref($key, $value) {
|
public function setUserPref($key, $value) {
|
||||||
if($this->getPreferences()) {
|
if($this->loadPreferences()) {
|
||||||
if(isset($this->user_preferences[$key])) {
|
if(isset($this->user_preferences[$key])) {
|
||||||
if($this->user_preferences[$key] == $value) {
|
if($this->user_preferences[$key] == $value) {
|
||||||
return; // no change
|
return; // no change
|
||||||
|
|
Loading…
Reference in New Issue