Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/editor/PhabricatorUserEditor.php
Show First 20 Lines • Show All 235 Lines • ▼ Show 20 Lines | $user->openTransaction(); | ||||
if ($email->getIsPrimary()) { | if ($email->getIsPrimary()) { | ||||
throw new Exception(pht("Can't remove primary email!")); | throw new Exception(pht("Can't remove primary email!")); | ||||
} | } | ||||
if ($email->getUserPHID() != $user->getPHID()) { | if ($email->getUserPHID() != $user->getPHID()) { | ||||
throw new Exception(pht('Email not owned by user!')); | throw new Exception(pht('Email not owned by user!')); | ||||
} | } | ||||
$email->delete(); | id(new PhabricatorDestructionEngine()) | ||||
->destroyObject($email); | |||||
$log = PhabricatorUserLog::initializeNewLog( | $log = PhabricatorUserLog::initializeNewLog( | ||||
$actor, | $actor, | ||||
$user->getPHID(), | $user->getPHID(), | ||||
PhabricatorRemoveEmailUserLogType::LOGTYPE); | PhabricatorRemoveEmailUserLogType::LOGTYPE); | ||||
$log->setOldValue($email->getAddress()); | $log->setOldValue($email->getAddress()); | ||||
$log->save(); | $log->save(); | ||||
▲ Show 20 Lines • Show All 255 Lines • Show Last 20 Lines |