From 7170b062e63c6a8f9441bf62425db6711c7a70d7 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 4 Jun 2016 16:25:11 -0700 Subject: [PATCH] Remove PhabricatorUser->loadPreferences() Summary: Ref T4103. This method has no more callers. Test Plan: `grep` Reviewers: chad Reviewed By: chad Maniphest Tasks: T4103 Differential Revision: https://secure.phabricator.com/D16039 --- .../people/storage/PhabricatorUser.php | 23 ------------------- .../storage/PhabricatorUserPreferences.php | 10 -------- 2 files changed, 33 deletions(-) diff --git a/src/applications/people/storage/PhabricatorUser.php b/src/applications/people/storage/PhabricatorUser.php index 3cfa7bd2bc..917e0d9a02 100644 --- a/src/applications/people/storage/PhabricatorUser.php +++ b/src/applications/people/storage/PhabricatorUser.php @@ -568,29 +568,6 @@ final class PhabricatorUser return $this->getUserSetting(PhabricatorPronounSetting::SETTINGKEY); } - public function loadPreferences() { - if ($this->preferences) { - return $this->preferences; - } - - $preferences = null; - if ($this->getPHID()) { - $preferences = id(new PhabricatorUserPreferencesQuery()) - ->setViewer($this) - ->withUsers(array($this)) - ->executeOne(); - } - - if (!$preferences) { - $preferences = new PhabricatorUserPreferences(); - $preferences->setUserPHID($this->getPHID()); - $preferences->attachUser($this); - } - - $this->preferences = $preferences; - return $preferences; - } - public function loadEditorLink( $path, $line, diff --git a/src/applications/settings/storage/PhabricatorUserPreferences.php b/src/applications/settings/storage/PhabricatorUserPreferences.php index 6769930004..81b93b89d7 100644 --- a/src/applications/settings/storage/PhabricatorUserPreferences.php +++ b/src/applications/settings/storage/PhabricatorUserPreferences.php @@ -98,16 +98,6 @@ final class PhabricatorUserPreferences return false; } - // TODO: Remove this once all edits go through the Editor. For now, some - // old edits just do direct saves so make sure we nuke the cache. - public function save() { - PhabricatorUserCache::clearCache( - PhabricatorUserPreferencesCacheType::KEY_PREFERENCES, - $this->getUserPHID()); - - return parent::save(); - } - /** * Load or create a preferences object for the given user. *