3 final class PhabricatorRepositoryURITransaction
4 extends PhabricatorApplicationTransaction
{
6 const TYPE_REPOSITORY
= 'diffusion.uri.repository';
7 const TYPE_URI
= 'diffusion.uri.uri';
8 const TYPE_IO
= 'diffusion.uri.io';
9 const TYPE_DISPLAY
= 'diffusion.uri.display';
10 const TYPE_CREDENTIAL
= 'diffusion.uri.credential';
11 const TYPE_DISABLE
= 'diffusion.uri.disable';
13 public function getApplicationName() {
17 public function getApplicationTransactionType() {
18 return PhabricatorRepositoryURIPHIDType
::TYPECONST
;
21 public function getRequiredHandlePHIDs() {
22 $phids = parent
::getRequiredHandlePHIDs();
24 $old = $this->getOldValue();
25 $new = $this->getNewValue();
27 switch ($this->getTransactionType()) {
28 case self
::TYPE_CREDENTIAL
:
41 public function getTitle() {
42 $author_phid = $this->getAuthorPHID();
44 $old = $this->getOldValue();
45 $new = $this->getNewValue();
47 switch ($this->getTransactionType()) {
50 '%s changed this URI from "%s" to "%s".',
51 $this->renderHandleLink($author_phid),
55 $map = PhabricatorRepositoryURI
::getIOTypeMap();
56 $old_label = idx(idx($map, $old, array()), 'label', $old);
57 $new_label = idx(idx($map, $new, array()), 'label', $new);
60 '%s changed the display type for this URI from "%s" to "%s".',
61 $this->renderHandleLink($author_phid),
64 case self
::TYPE_DISPLAY
:
65 $map = PhabricatorRepositoryURI
::getDisplayTypeMap();
66 $old_label = idx(idx($map, $old, array()), 'label', $old);
67 $new_label = idx(idx($map, $new, array()), 'label', $new);
70 '%s changed the display type for this URI from "%s" to "%s".',
71 $this->renderHandleLink($author_phid),
74 case self
::TYPE_DISABLE
:
77 '%s disabled this URI.',
78 $this->renderHandleLink($author_phid));
81 '%s enabled this URI.',
82 $this->renderHandleLink($author_phid));
84 case self
::TYPE_CREDENTIAL
:
87 '%s changed the credential for this URI from %s to %s.',
88 $this->renderHandleLink($author_phid),
89 $this->renderHandleLink($old),
90 $this->renderHandleLink($new));
93 '%s removed %s as the credential for this URI.',
94 $this->renderHandleLink($author_phid),
95 $this->renderHandleLink($old));
98 '%s set the credential for this URI to %s.',
99 $this->renderHandleLink($author_phid),
100 $this->renderHandleLink($new));
105 return parent
::getTitle();