3 final class PhabricatorRepositoryTouchLimitTransaction
4 extends PhabricatorRepositoryTransactionType
{
6 const TRANSACTIONTYPE
= 'limit.touch';
8 public function generateOldValue($object) {
9 return $object->getTouchLimit();
12 public function generateNewValue($object, $value) {
13 if (!strlen($value)) {
25 public function applyInternalEffects($object, $value) {
26 $object->setTouchLimit($value);
29 public function getTitle() {
30 $old = $this->getOldValue();
31 $new = $this->getNewValue();
35 '%s changed the touch limit for this repository from %s paths to '.
37 $this->renderAuthor(),
38 $this->renderOldValue(),
39 $this->renderNewValue());
42 '%s set the touch limit for this repository to %s paths.',
43 $this->renderAuthor(),
44 $this->renderNewValue());
47 '%s removed the touch limit (%s paths) for this repository.',
48 $this->renderAuthor(),
49 $this->renderOldValue());
53 public function validateTransactions($object, array $xactions) {
56 foreach ($xactions as $xaction) {
57 $new = $xaction->getNewValue();
63 if (!preg_match('/^\d+\z/', $new)) {
64 $errors[] = $this->newInvalidError(
66 'Unable to parse touch limit, specify a positive number of '.