1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00
phorge-phorge/src/applications/calendar/xaction/PhabricatorCalendarEventCancelTransaction.php

47 lines
1,012 B
PHP
Raw Normal View History

<?php
final class PhabricatorCalendarEventCancelTransaction
extends PhabricatorCalendarEventTransactionType {
const TRANSACTIONTYPE = 'calendar.cancel';
public function generateOldValue($object) {
return (int)$object->getIsCancelled();
}
public function generateNewValue($object, $value) {
return (int)$value;
}
public function applyInternalEffects($object, $value) {
$object->setIsCancelled($value);
}
public function getTitle() {
if ($this->getNewValue()) {
return pht(
'%s cancelled this event.',
$this->renderAuthor());
} else {
return pht(
'%s reinstated this event.',
$this->renderAuthor());
}
}
public function getTitleForFeed() {
if ($this->getNewValue()) {
return pht(
'%s cancelled %s.',
$this->renderAuthor(),
$this->renderObject());
} else {
return pht(
'%s reinstated %s.',
$this->renderAuthor(),
$this->renderObject());
}
}
}