Differential D20670 Diff 49310 src/applications/people/xaction/PhabricatorUserDisableTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/xaction/PhabricatorUserDisableTransaction.php
Show All 11 Lines | final class PhabricatorUserDisableTransaction | ||||
public function generateNewValue($object, $value) { | public function generateNewValue($object, $value) { | ||||
return (bool)$value; | return (bool)$value; | ||||
} | } | ||||
public function applyInternalEffects($object, $value) { | public function applyInternalEffects($object, $value) { | ||||
$object->setIsDisabled((int)$value); | $object->setIsDisabled((int)$value); | ||||
} | } | ||||
public function applyExternalEffects($object, $value) { | |||||
$this->newUserLog(PhabricatorUserLog::ACTION_DISABLE) | |||||
->setOldValue((bool)$object->getIsDisabled()) | |||||
->setNewValue((bool)$value) | |||||
->save(); | |||||
} | |||||
public function getTitle() { | public function getTitle() { | ||||
$new = $this->getNewValue(); | $new = $this->getNewValue(); | ||||
if ($new) { | if ($new) { | ||||
return pht( | return pht( | ||||
'%s disabled this user.', | '%s disabled this user.', | ||||
$this->renderAuthor()); | $this->renderAuthor()); | ||||
} else { | } else { | ||||
return pht( | return pht( | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |