Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/storage/PhabricatorUser.php
Show First 20 Lines • Show All 452 Lines • ▼ Show 20 Lines | public function loadPrimaryEmailAddress() { | ||||
$email = $this->loadPrimaryEmail(); | $email = $this->loadPrimaryEmail(); | ||||
if (!$email) { | if (!$email) { | ||||
throw new Exception(pht('User has no primary email address!')); | throw new Exception(pht('User has no primary email address!')); | ||||
} | } | ||||
return $email->getAddress(); | return $email->getAddress(); | ||||
} | } | ||||
public function loadPrimaryEmail() { | public function loadPrimaryEmail() { | ||||
$email = new PhabricatorUserEmail(); | |||||
$conn = $email->establishConnection('r'); | |||||
return $this->loadOneRelative( | return $this->loadOneRelative( | ||||
new PhabricatorUserEmail(), | $email, | ||||
'userPHID', | 'userPHID', | ||||
'getPHID', | 'getPHID', | ||||
'(isPrimary = 1)'); | qsprintf($conn, '(isPrimary = 1)')); | ||||
} | } | ||||
/* -( Settings )----------------------------------------------------------- */ | /* -( Settings )----------------------------------------------------------- */ | ||||
public function getUserSetting($key) { | public function getUserSetting($key) { | ||||
// NOTE: We store available keys and cached values separately to make it | // NOTE: We store available keys and cached values separately to make it | ||||
▲ Show 20 Lines • Show All 1,214 Lines • Show Last 20 Lines |