Path: blob/master/src/applications/macro/xaction/PhabricatorMacroAudioTransaction.php
12241 views
<?php12final class PhabricatorMacroAudioTransaction3extends PhabricatorMacroTransactionType {45const TRANSACTIONTYPE = 'macro:audio';67public function generateOldValue($object) {8return $object->getAudioPHID();9}1011public function applyInternalEffects($object, $value) {12$object->setAudioPHID($value);13}1415public function extractFilePHIDs($object, $value) {16$file_phids = array();1718if ($value) {19$file_phids[] = $value;20}2122return $file_phids;23}2425public function getTitle() {26$new = $this->getNewValue();27$old = $this->getOldValue();28if (!$old) {29return pht(30'%s attached audio: %s.',31$this->renderAuthor(),32$this->renderHandle($new));33} else {34return pht(35'%s changed the audio for this macro from %s to %s.',36$this->renderAuthor(),37$this->renderHandle($old),38$this->renderHandle($new));39}40}4142public function getTitleForFeed() {43$new = $this->getNewValue();44$old = $this->getOldValue();45if (!$old) {46return pht(47'%s attached audio to %s: %s.',48$this->renderAuthor(),49$this->renderObject(),50$this->renderHandle($new));51} else {52return pht(53'%s changed the audio for %s from %s to %s.',54$this->renderAuthor(),55$this->renderObject(),56$this->renderHandle($old),57$this->renderHandle($new));58}59}6061public function getIcon() {62return 'fa-music';63}6465}666768