Differential D19829 Diff 47354 src/applications/repository/xaction/PhabricatorRepositoryAutocloseTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/xaction/PhabricatorRepositoryAutocloseTransaction.php
- This file was added.
<?php | |||||
final class PhabricatorRepositoryAutocloseTransaction | |||||
extends PhabricatorRepositoryTransactionType { | |||||
const TRANSACTIONTYPE = 'repo:autoclose'; | |||||
public function generateOldValue($object) { | |||||
return (int)!$object->getDetail('disable-autoclose'); | |||||
} | |||||
public function generateNewValue($object, $value) { | |||||
return (int)$value; | |||||
} | |||||
public function applyInternalEffects($object, $value) { | |||||
$object->setDetail('disable-autoclose', (int)!$value); | |||||
} | |||||
public function getTitle() { | |||||
$new = $this->getNewValue(); | |||||
if ($new) { | |||||
return pht( | |||||
'%s enabled autoclose for this repository.', | |||||
$this->renderAuthor()); | |||||
} else { | |||||
return pht( | |||||
'%s disabled autoclose for this repository.', | |||||
$this->renderAuthor()); | |||||
} | |||||
} | |||||
} |