Path: blob/master/src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php
12241 views
<?php12final class PhabricatorPasteTitleTransaction3extends PhabricatorPasteTransactionType {45const TRANSACTIONTYPE = 'paste.title';67public function generateOldValue($object) {8return $object->getTitle();9}1011public function applyInternalEffects($object, $value) {12$object->setTitle($value);13}1415public function getTitle() {16$old = $this->getOldValue();17$new = $this->getNewValue();1819if (strlen($old) && strlen($new)) {20return pht(21'%s changed the title of this paste from %s to %s.',22$this->renderAuthor(),23$this->renderOldValue(),24$this->renderNewValue());25} else if (strlen($new)) {26return pht(27'%s changed the title of this paste from untitled to %s.',28$this->renderAuthor(),29$this->renderNewValue());30} else {31return pht(32'%s changed the title of this paste from %s to untitled.',33$this->renderAuthor(),34$this->renderOldValue());35}36}3738public function getTitleForFeed() {39$old = $this->getOldValue();40$new = $this->getNewValue();4142if (strlen($old) && strlen($new)) {43return pht(44'%s updated the title for %s from %s to %s.',45$this->renderAuthor(),46$this->renderObject(),47$this->renderOldValue(),48$this->renderNewValue());49} else if (strlen($new)) {50return pht(51'%s updated the title for %s from untitled to %s.',52$this->renderAuthor(),53$this->renderObject(),54$this->renderNewValue());55} else {56return pht(57'%s updated the title for %s from %s to untitled.',58$this->renderAuthor(),59$this->renderObject(),60$this->renderOldValue());61}62}6364}656667