1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-04 12:42:43 +01:00
phorge-phorge/src/applications/owners/xaction/PhabricatorOwnersPackageStatusTransaction.php
Mike Riley 8247edff98 Modularize Owners package transactions
Summary: Converts Owners package transactions to modular transactions.

Test Plan:
 - created a new package
 - edited all simple properties from the web ui
 - checked that project and user owners were added as reviewers appropriately to new diffs
 - inspected the change details for various types of path add / remove / update / reorder changes

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D16651
2016-10-13 21:07:02 +00:00

29 lines
716 B
PHP

<?php
final class PhabricatorOwnersPackageStatusTransaction
extends PhabricatorOwnersPackageTransactionType {
const TRANSACTIONTYPE = 'owners.status';
public function generateOldValue($object) {
return $object->getStatus();
}
public function applyInternalEffects($object, $value) {
$object->setStatus($value);
}
public function getTitle() {
$new = $this->getNewValue();
if ($new == PhabricatorOwnersPackage::STATUS_ACTIVE) {
return pht(
'%s activated this package.',
$this->renderAuthor());
} else if ($new == PhabricatorOwnersPackage::STATUS_ARCHIVED) {
return pht(
'%s archived this package.',
$this->renderAuthor());
}
}
}