Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/herald/xaction/HeraldRuleDisableTransaction.php
12256 views
1
<?php
2
3
final class HeraldRuleDisableTransaction
4
extends HeraldRuleTransactionType {
5
6
const TRANSACTIONTYPE = 'herald:disable';
7
8
public function generateOldValue($object) {
9
return (bool)$object->getIsDisabled();
10
}
11
12
public function generateNewValue($object, $value) {
13
return (bool)$value;
14
}
15
16
public function applyInternalEffects($object, $value) {
17
$object->setIsDisabled((int)$value);
18
}
19
20
public function getTitle() {
21
if ($this->getNewValue()) {
22
return pht(
23
'%s disabled this rule.',
24
$this->renderAuthor());
25
} else {
26
return pht(
27
'%s enabled this rule.',
28
$this->renderAuthor());
29
}
30
}
31
32
}
33
34