Changeset View
Changeset View
Standalone View
Standalone View
src/applications/release/xaction/ReleaseReleaseNameTransaction.php
- This file was added.
<?php | |||||
final class ReleaseReleaseNameTransaction | |||||
extends ReleaseReleaseTransactionType { | |||||
const TRANSACTIONTYPE = 'release:name'; | |||||
public function generateOldValue($object) { | |||||
return $object->getName(); | |||||
} | |||||
public function applyInternalEffects($object, $value) { | |||||
$object->setName($value); | |||||
} | |||||
public function shouldHide() { | |||||
$old = $this->getOldValue(); | |||||
if (is_array($old) && !$old) { | |||||
return true; | |||||
} | |||||
if (!is_array($old) && !strlen($old)) { | |||||
return true; | |||||
} | |||||
} | |||||
public function getTitle() { | |||||
return pht( | |||||
'%s renamed the release from "%s" to "%s".', | |||||
$this->renderAuthor(), | |||||
$this->getOldValue(), | |||||
$this->getNewValue()); | |||||
} | |||||
public function getTitleForFeed() { | |||||
return pht( | |||||
'%s renamed the release for %s from "%s" to "%s".', | |||||
$this->renderAuthor(), | |||||
$this->renderObject(), | |||||
$this->getOldValue(), | |||||
$this->getNewValue()); | |||||
} | |||||
} |