Path: blob/master/src/applications/badges/xaction/PhabricatorBadgesBadgeIconTransaction.php
12256 views
<?php12final class PhabricatorBadgesBadgeIconTransaction3extends PhabricatorBadgesBadgeTransactionType {45const TRANSACTIONTYPE = 'badge.icon';67public function generateOldValue($object) {8return $object->getIcon();9}1011public function applyInternalEffects($object, $value) {12$object->setIcon($value);13}1415public function shouldHide() {16if ($this->isCreateTransaction()) {17return true;18}1920return false;21}2223public function getTitle() {24$old = $this->getIconLabel($this->getOldValue());25$new = $this->getIconLabel($this->getNewValue());2627return pht(28'%s changed the badge icon from %s to %s.',29$this->renderAuthor(),30$this->renderValue($old),31$this->renderValue($new));32}3334public function getTitleForFeed() {35$old = $this->getIconLabel($this->getOldValue());36$new = $this->getIconLabel($this->getNewValue());3738return pht(39'%s changed the badge icon for %s from %s to %s.',40$this->renderAuthor(),41$this->renderObject(),42$this->renderValue($old),43$this->renderValue($new));44}4546private function getIconLabel($icon) {47$set = new PhabricatorBadgesIconSet();48return $set->getIconLabel($icon);49}5051public function getIcon() {52return $this->getNewValue();53}5455}565758