3 final class PhabricatorRepositoryCopyTimeLimitTransaction
4 extends PhabricatorRepositoryTransactionType
{
6 const TRANSACTIONTYPE
= 'limit.copy';
8 public function generateOldValue($object) {
9 return $object->getCopyTimeLimit();
12 public function generateNewValue($object, $value) {
13 if (!strlen($value)) {
25 public function applyInternalEffects($object, $value) {
26 $object->setCopyTimeLimit($value);
29 public function getTitle() {
30 $old = $this->getOldValue();
31 $new = $this->getNewValue();
35 '%s changed the copy time limit for this repository from %s seconds '.
37 $this->renderAuthor(),
38 $this->renderOldValue(),
39 $this->renderNewValue());
42 '%s set the copy time limit for this repository to %s seconds.',
43 $this->renderAuthor(),
44 $this->renderNewValue());
47 '%s reset the copy time limit (%s seconds) for this repository '.
48 'to the default value.',
49 $this->renderAuthor(),
50 $this->renderOldValue());
54 public function validateTransactions($object, array $xactions) {
57 foreach ($xactions as $xaction) {
58 $new = $xaction->getNewValue();
64 if (!preg_match('/^\d+\z/', $new)) {
65 $errors[] = $this->newInvalidError(
67 'Unable to parse copy time limit, specify a positive number '.