Differential D16699 Diff 40199 src/applications/calendar/xaction/PhabricatorCalendarImportDisableTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/xaction/PhabricatorCalendarImportDisableTransaction.php
- This file was added.
<?php | |||||
final class PhabricatorCalendarImportDisableTransaction | |||||
extends PhabricatorCalendarImportTransactionType { | |||||
const TRANSACTIONTYPE = 'calendar.import.disable'; | |||||
public function generateOldValue($object) { | |||||
return (int)$object->getIsDisabled(); | |||||
} | |||||
public function applyInternalEffects($object, $value) { | |||||
$object->setIsDisabled((int)$value); | |||||
} | |||||
public function getTitle() { | |||||
if ($this->getNewValue()) { | |||||
return pht( | |||||
'%s disabled this import.', | |||||
$this->renderAuthor()); | |||||
} else { | |||||
return pht( | |||||
'%s enabled this import.', | |||||
$this->renderAuthor()); | |||||
} | |||||
} | |||||
} |