Remove product literal strings in "pht()", part 18
[phabricator.git] / src / applications / slowvote / xaction / PhabricatorSlowvoteCloseTransaction.php
blobce3eaf58798434615e04eccc116de65e9e33ee85
1 <?php
3 final class PhabricatorSlowvoteCloseTransaction
4 extends PhabricatorSlowvoteTransactionType {
6 const TRANSACTIONTYPE = 'vote:close';
8 public function generateOldValue($object) {
9 return (bool)$object->getIsClosed();
12 public function generateNewValue($object, $value) {
13 return (bool)$value;
16 public function applyInternalEffects($object, $value) {
17 $object->setIsClosed((int)$value);
20 public function getTitle() {
21 $new = $this->getNewValue();
23 if ($new) {
24 return pht(
25 '%s closed this poll.',
26 $this->renderAuthor());
27 } else {
28 return pht(
29 '%s reopened this poll.',
30 $this->renderAuthor());
34 public function getTitleForFeed() {
35 $new = $this->getNewValue();
37 if ($new) {
38 return pht(
39 '%s closed %s.',
40 $this->renderAuthor(),
41 $this->renderObject());
42 } else {
43 return pht(
44 '%s reopened %s.',
45 $this->renderAuthor(),
46 $this->renderObject());
50 public function getIcon() {
51 $new = $this->getNewValue();
53 if ($new) {
54 return 'fa-ban';
55 } else {
56 return 'fa-pencil';