3 final class PhluxVariableEditor
4 extends PhabricatorApplicationTransactionEditor
{
6 public function getEditorApplicationClass() {
7 return 'PhabricatorPhluxApplication';
10 public function getEditorObjectsDescription() {
11 return pht('Phlux Variables');
14 public function getTransactionTypes() {
15 $types = parent
::getTransactionTypes();
16 $types[] = PhluxTransaction
::TYPE_EDIT_KEY
;
17 $types[] = PhluxTransaction
::TYPE_EDIT_VALUE
;
18 $types[] = PhabricatorTransactions
::TYPE_VIEW_POLICY
;
19 $types[] = PhabricatorTransactions
::TYPE_EDIT_POLICY
;
23 protected function getCustomTransactionOldValue(
24 PhabricatorLiskDAO
$object,
25 PhabricatorApplicationTransaction
$xaction) {
26 switch ($xaction->getTransactionType()) {
27 case PhluxTransaction
::TYPE_EDIT_KEY
:
28 return $object->getVariableKey();
29 case PhluxTransaction
::TYPE_EDIT_VALUE
:
30 return $object->getVariableValue();
33 return parent
::getCustomTransactionOldValue($object, $xaction);
36 protected function getCustomTransactionNewValue(
37 PhabricatorLiskDAO
$object,
38 PhabricatorApplicationTransaction
$xaction) {
39 switch ($xaction->getTransactionType()) {
40 case PhluxTransaction
::TYPE_EDIT_KEY
:
41 case PhluxTransaction
::TYPE_EDIT_VALUE
:
42 return $xaction->getNewValue();
44 return parent
::getCustomTransactionNewValue($object, $xaction);
47 protected function applyCustomInternalTransaction(
48 PhabricatorLiskDAO
$object,
49 PhabricatorApplicationTransaction
$xaction) {
50 switch ($xaction->getTransactionType()) {
51 case PhluxTransaction
::TYPE_EDIT_KEY
:
52 $object->setVariableKey($xaction->getNewValue());
54 case PhluxTransaction
::TYPE_EDIT_VALUE
:
55 $object->setVariableValue($xaction->getNewValue());
58 return parent
::applyCustomInternalTransaction($object, $xaction);
61 protected function applyCustomExternalTransaction(
62 PhabricatorLiskDAO
$object,
63 PhabricatorApplicationTransaction
$xaction) {
64 switch ($xaction->getTransactionType()) {
65 case PhluxTransaction
::TYPE_EDIT_KEY
:
66 case PhluxTransaction
::TYPE_EDIT_VALUE
:
69 return parent
::applyCustomExternalTransaction($object, $xaction);