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(); | return id(new PhabricatorUserEmail())->loadOneWhere( | ||||
$conn = $email->establishConnection('r'); | 'userPHID = %s AND isPrimary = 1', | ||||
$this->getPHID()); | |||||
return $this->loadOneRelative( | |||||
$email, | |||||
'userPHID', | |||||
'getPHID', | |||||
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,217 Lines • Show Last 20 Lines |