Path: blob/master/src/applications/herald/xaction/HeraldRuleEditTransaction.php
12256 views
<?php12final class HeraldRuleEditTransaction3extends HeraldRuleTransactionType {45const TRANSACTIONTYPE = 'herald:edit';67public function generateOldValue($object) {8return id(new HeraldRuleSerializer())9->serializeRule($object);10}1112public function applyInternalEffects($object, $value) {13$new_state = id(new HeraldRuleSerializer())14->deserializeRuleComponents($value);1516$object->setMustMatchAll((int)$new_state['match_all']);17$object->attachConditions($new_state['conditions']);18$object->attachActions($new_state['actions']);1920$new_repetition = $new_state['repetition_policy'];21$object->setRepetitionPolicyStringConstant($new_repetition);22}2324public function applyExternalEffects($object, $value) {25$object->saveConditions($object->getConditions());26$object->saveActions($object->getActions());27}2829public function getTitle() {30return pht(31'%s edited this rule.',32$this->renderAuthor());33}3435public function hasChangeDetailView() {36return true;37}3839public function newChangeDetailView() {40$viewer = $this->getViewer();4142return id(new PhabricatorApplicationTransactionJSONDiffDetailView())43->setViewer($viewer)44->setOld($this->getOldValue())45->setNew($this->getNewValue());46}4748}495051