Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phortune/editor/PhortuneMerchantEditor.php
Show All 11 Lines | final class PhortuneMerchantEditor | ||||
} | } | ||||
public function getTransactionTypes() { | public function getTransactionTypes() { | ||||
$types = parent::getTransactionTypes(); | $types = parent::getTransactionTypes(); | ||||
$types[] = PhortuneMerchantTransaction::TYPE_NAME; | $types[] = PhortuneMerchantTransaction::TYPE_NAME; | ||||
$types[] = PhortuneMerchantTransaction::TYPE_DESCRIPTION; | $types[] = PhortuneMerchantTransaction::TYPE_DESCRIPTION; | ||||
$types[] = PhortuneMerchantTransaction::TYPE_CONTACTINFO; | $types[] = PhortuneMerchantTransaction::TYPE_CONTACTINFO; | ||||
$types[] = PhortuneMerchantTransaction::TYPE_PICTURE; | |||||
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY; | $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY; | ||||
$types[] = PhabricatorTransactions::TYPE_EDGE; | $types[] = PhabricatorTransactions::TYPE_EDGE; | ||||
return $types; | return $types; | ||||
} | } | ||||
protected function getCustomTransactionOldValue( | protected function getCustomTransactionOldValue( | ||||
PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
PhabricatorApplicationTransaction $xaction) { | PhabricatorApplicationTransaction $xaction) { | ||||
switch ($xaction->getTransactionType()) { | switch ($xaction->getTransactionType()) { | ||||
case PhortuneMerchantTransaction::TYPE_NAME: | case PhortuneMerchantTransaction::TYPE_NAME: | ||||
return $object->getName(); | return $object->getName(); | ||||
case PhortuneMerchantTransaction::TYPE_DESCRIPTION: | case PhortuneMerchantTransaction::TYPE_DESCRIPTION: | ||||
return $object->getDescription(); | return $object->getDescription(); | ||||
case PhortuneMerchantTransaction::TYPE_CONTACTINFO: | case PhortuneMerchantTransaction::TYPE_CONTACTINFO: | ||||
return $object->getContactInfo(); | return $object->getContactInfo(); | ||||
case PhortuneMerchantTransaction::TYPE_PICTURE: | |||||
return $object->getProfileImagePHID(); | |||||
} | } | ||||
return parent::getCustomTransactionOldValue($object, $xaction); | return parent::getCustomTransactionOldValue($object, $xaction); | ||||
} | } | ||||
protected function getCustomTransactionNewValue( | protected function getCustomTransactionNewValue( | ||||
PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
PhabricatorApplicationTransaction $xaction) { | PhabricatorApplicationTransaction $xaction) { | ||||
switch ($xaction->getTransactionType()) { | switch ($xaction->getTransactionType()) { | ||||
case PhortuneMerchantTransaction::TYPE_NAME: | case PhortuneMerchantTransaction::TYPE_NAME: | ||||
case PhortuneMerchantTransaction::TYPE_DESCRIPTION: | case PhortuneMerchantTransaction::TYPE_DESCRIPTION: | ||||
case PhortuneMerchantTransaction::TYPE_CONTACTINFO: | case PhortuneMerchantTransaction::TYPE_CONTACTINFO: | ||||
case PhortuneMerchantTransaction::TYPE_PICTURE: | |||||
return $xaction->getNewValue(); | return $xaction->getNewValue(); | ||||
} | } | ||||
return parent::getCustomTransactionNewValue($object, $xaction); | return parent::getCustomTransactionNewValue($object, $xaction); | ||||
} | } | ||||
protected function applyCustomInternalTransaction( | protected function applyCustomInternalTransaction( | ||||
PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
PhabricatorApplicationTransaction $xaction) { | PhabricatorApplicationTransaction $xaction) { | ||||
switch ($xaction->getTransactionType()) { | switch ($xaction->getTransactionType()) { | ||||
case PhortuneMerchantTransaction::TYPE_NAME: | case PhortuneMerchantTransaction::TYPE_NAME: | ||||
$object->setName($xaction->getNewValue()); | $object->setName($xaction->getNewValue()); | ||||
return; | return; | ||||
case PhortuneMerchantTransaction::TYPE_DESCRIPTION: | case PhortuneMerchantTransaction::TYPE_DESCRIPTION: | ||||
$object->setDescription($xaction->getNewValue()); | $object->setDescription($xaction->getNewValue()); | ||||
return; | return; | ||||
case PhortuneMerchantTransaction::TYPE_CONTACTINFO: | case PhortuneMerchantTransaction::TYPE_CONTACTINFO: | ||||
$object->setContactInfo($xaction->getNewValue()); | $object->setContactInfo($xaction->getNewValue()); | ||||
return; | return; | ||||
case PhortuneMerchantTransaction::TYPE_PICTURE: | |||||
$object->setProfileImagePHID($xaction->getNewValue()); | |||||
return; | |||||
} | } | ||||
return parent::applyCustomInternalTransaction($object, $xaction); | return parent::applyCustomInternalTransaction($object, $xaction); | ||||
} | } | ||||
protected function applyCustomExternalTransaction( | protected function applyCustomExternalTransaction( | ||||
PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
PhabricatorApplicationTransaction $xaction) { | PhabricatorApplicationTransaction $xaction) { | ||||
switch ($xaction->getTransactionType()) { | switch ($xaction->getTransactionType()) { | ||||
case PhortuneMerchantTransaction::TYPE_NAME: | case PhortuneMerchantTransaction::TYPE_NAME: | ||||
case PhortuneMerchantTransaction::TYPE_DESCRIPTION: | case PhortuneMerchantTransaction::TYPE_DESCRIPTION: | ||||
case PhortuneMerchantTransaction::TYPE_CONTACTINFO: | case PhortuneMerchantTransaction::TYPE_CONTACTINFO: | ||||
case PhortuneMerchantTransaction::TYPE_PICTURE: | |||||
return; | return; | ||||
} | } | ||||
return parent::applyCustomExternalTransaction($object, $xaction); | return parent::applyCustomExternalTransaction($object, $xaction); | ||||
} | } | ||||
protected function validateTransaction( | protected function validateTransaction( | ||||
PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
Show All 28 Lines |