Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / phortune / xaction / paymentmethod / PhortunePaymentMethodNameTransaction.php
blob4e25877e153e6e20f2d8c16a19d6f5edfec4e6b0
1 <?php
3 final class PhortunePaymentMethodNameTransaction
4 extends PhortunePaymentMethodTransactionType {
6 const TRANSACTIONTYPE = 'name';
8 public function generateOldValue($object) {
9 return $object->getName();
12 public function applyInternalEffects($object, $value) {
13 $object->setName($value);
16 public function getTitle() {
17 $old_value = $this->getOldValue();
18 $new_value = $this->getNewValue();
20 if (strlen($old_value) && strlen($new_value)) {
21 return pht(
22 '%s renamed this payment method from %s to %s.',
23 $this->renderAuthor(),
24 $this->renderOldValue(),
25 $this->renderNewValue());
26 } else if (strlen($new_value)) {
27 return pht(
28 '%s set the name of this payment method to %s.',
29 $this->renderAuthor(),
30 $this->renderNewValue());
31 } else {
32 return pht(
33 '%s removed the name of this payment method (was: %s).',
34 $this->renderAuthor(),
35 $this->renderOldValue());