Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / auth / storage / PhabricatorAuthSSHKeyTransaction.php
blob028be1746dce0d816e4f59e463166a4a40e66593
1 <?php
3 final class PhabricatorAuthSSHKeyTransaction
4 extends PhabricatorApplicationTransaction {
6 const TYPE_NAME = 'sshkey.name';
7 const TYPE_KEY = 'sshkey.key';
8 const TYPE_DEACTIVATE = 'sshkey.deactivate';
10 public function getApplicationName() {
11 return 'auth';
14 public function getApplicationTransactionType() {
15 return PhabricatorAuthSSHKeyPHIDType::TYPECONST;
18 public function getTitle() {
19 $author_phid = $this->getAuthorPHID();
21 $old = $this->getOldValue();
22 $new = $this->getNewValue();
24 switch ($this->getTransactionType()) {
25 case PhabricatorTransactions::TYPE_CREATE:
26 return pht(
27 '%s created this key.',
28 $this->renderHandleLink($author_phid));
29 case self::TYPE_NAME:
30 return pht(
31 '%s renamed this key from "%s" to "%s".',
32 $this->renderHandleLink($author_phid),
33 $old,
34 $new);
35 case self::TYPE_KEY:
36 return pht(
37 '%s updated the public key material for this SSH key.',
38 $this->renderHandleLink($author_phid));
39 case self::TYPE_DEACTIVATE:
40 if ($new) {
41 return pht(
42 '%s revoked this key.',
43 $this->renderHandleLink($author_phid));
44 } else {
45 return pht(
46 '%s reinstated this key.',
47 $this->renderHandleLink($author_phid));
52 return parent::getTitle();