Path: blob/master/src/applications/badges/xaction/PhabricatorBadgesBadgeStatusTransaction.php
12256 views
<?php12final class PhabricatorBadgesBadgeStatusTransaction3extends PhabricatorBadgesBadgeTransactionType {45const TRANSACTIONTYPE = 'badges.status';67public function generateOldValue($object) {8return $object->getStatus();9}1011public function applyInternalEffects($object, $value) {12$object->setStatus($value);13}1415public function getTitle() {16if ($this->getNewValue() == PhabricatorBadgesBadge::STATUS_ARCHIVED) {17return pht(18'%s disabled this badge.',19$this->renderAuthor());20} else {21return pht(22'%s enabled this badge.',23$this->renderAuthor());24}25}2627public function getTitleForFeed() {28if ($this->getNewValue() == PhabricatorBadgesBadge::STATUS_ARCHIVED) {29return pht(30'%s disabled the badge %s.',31$this->renderAuthor(),32$this->renderObject());33} else {34return pht(35'%s enabled the badge %s.',36$this->renderAuthor(),37$this->renderObject());38}39}4041public function getIcon() {42if ($this->getNewValue() == PhabricatorBadgesBadge::STATUS_ARCHIVED) {43return 'fa-ban';44} else {45return 'fa-check';46}47}4849}505152