Changeset View
Changeset View
Standalone View
Standalone View
src/applications/release/xaction/ReleaseReleaseStateTransaction.php
- This file was added.
<?php | |||||
final class ReleaseReleaseStateTransaction | |||||
extends ReleaseReleaseTransactionType { | |||||
const TRANSACTIONTYPE = 'release:state'; | |||||
public function generateOldValue($object) { | |||||
return $object->getState(); | |||||
} | |||||
public function applyInternalEffects($object, $value) { | |||||
$object->setState($value); | |||||
} | |||||
public function getColor() { | |||||
return 'orange'; | |||||
} | |||||
public function getTitle() { | |||||
$states = ReleaseRelease::getStatesMap(); | |||||
$old = $this->getOldValue(); | |||||
$new = $this->getNewValue(); | |||||
return pht( | |||||
'%s changed the status of this release from "%s" to "%s"', | |||||
$this->renderAuthor(), | |||||
idx($states, $old, $old), | |||||
idx($states, $new, $new)); | |||||
} | |||||
public function getTitleForFeed() { | |||||
$states = ReleaseRelease::getStatesMap(); | |||||
$old = $this->getOldValue(); | |||||
$new = $this->getNewValue(); | |||||
return pht( | |||||
'%s changed the status of release %s from "%s" to "%s"', | |||||
$this->renderAuthor(), | |||||
$this->renderObject(), | |||||
idx($states, $old, $old), | |||||
idx($states, $new, $new)); | |||||
} | |||||
} |