Changeset View
Changeset View
Standalone View
Standalone View
src/applications/settings/storage/PhabricatorUserPreferences.php
| Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | public function setPreference($key, $value) { | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function unsetPreference($key) { | public function unsetPreference($key) { | ||||
| unset($this->preferences[$key]); | unset($this->preferences[$key]); | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getDefaultValue($key) { | |||||
| $setting = self::getSettingObject($key); | |||||
| if (!$setting) { | |||||
| return null; | |||||
| } | |||||
| return $setting->getSettingDefaultValue(); | |||||
| } | |||||
| private static function getSettingObject($key) { | |||||
| $settings = PhabricatorSetting::getAllSettings(); | |||||
| return idx($settings, $key); | |||||
| } | |||||
| public function getPinnedApplications(array $apps, PhabricatorUser $viewer) { | public function getPinnedApplications(array $apps, PhabricatorUser $viewer) { | ||||
| $pref_pinned = self::PREFERENCE_APP_PINNED; | $pref_pinned = self::PREFERENCE_APP_PINNED; | ||||
| $pinned = $this->getPreference($pref_pinned); | $pinned = $this->getPreference($pref_pinned); | ||||
| if ($pinned) { | if ($pinned) { | ||||
| return $pinned; | return $pinned; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | public function destroyObjectPermanently( | ||||
| $this->delete(); | $this->delete(); | ||||
| } | } | ||||
| /* -( PhabricatorApplicationTransactionInterface )------------------------- */ | /* -( PhabricatorApplicationTransactionInterface )------------------------- */ | ||||
| public function getApplicationTransactionEditor() { | public function getApplicationTransactionEditor() { | ||||
| // TODO: Implement. | return new PhabricatorUserPreferencesEditor(); | ||||
| throw new PhutilMethodNotImplementedException(); | |||||
| } | } | ||||
| public function getApplicationTransactionObject() { | public function getApplicationTransactionObject() { | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getApplicationTransactionTemplate() { | public function getApplicationTransactionTemplate() { | ||||
| return new PhabricatorUserPreferencesTransaction(); | return new PhabricatorUserPreferencesTransaction(); | ||||
| Show All 9 Lines | |||||