3
final class PhabricatorSpacesNamespaceTransaction
4
extends PhabricatorApplicationTransaction {
6
const TYPE_NAME = 'spaces:name';
7
const TYPE_DEFAULT = 'spaces:default';
8
const TYPE_DESCRIPTION = 'spaces:description';
9
const TYPE_ARCHIVE = 'spaces:archive';
11
public function getApplicationName() {
15
public function getApplicationTransactionType() {
16
return PhabricatorSpacesNamespacePHIDType::TYPECONST;
19
public function getApplicationTransactionCommentObject() {
23
public function shouldHide() {
24
$old = $this->getOldValue();
26
switch ($this->getTransactionType()) {
27
case self::TYPE_DESCRIPTION:
28
return ($old === null);
31
return parent::shouldHide();
34
public function hasChangeDetails() {
35
switch ($this->getTransactionType()) {
36
case self::TYPE_DESCRIPTION:
40
return parent::hasChangeDetails();
43
public function getRemarkupBlocks() {
44
$blocks = parent::getRemarkupBlocks();
46
switch ($this->getTransactionType()) {
47
case self::TYPE_DESCRIPTION:
48
$blocks[] = $this->getNewValue();
55
public function getTitle() {
56
$old = $this->getOldValue();
57
$new = $this->getNewValue();
59
$author_phid = $this->getAuthorPHID();
61
switch ($this->getTransactionType()) {
65
'%s created this space.',
66
$this->renderHandleLink($author_phid));
69
'%s renamed this space from "%s" to "%s".',
70
$this->renderHandleLink($author_phid),
74
case self::TYPE_DESCRIPTION:
76
'%s updated the description for this space.',
77
$this->renderHandleLink($author_phid));
78
case self::TYPE_DEFAULT:
80
'%s made this the default space.',
81
$this->renderHandleLink($author_phid));
82
case self::TYPE_ARCHIVE:
85
'%s archived this space.',
86
$this->renderHandleLink($author_phid));
89
'%s activated this space.',
90
$this->renderHandleLink($author_phid));
94
return parent::getTitle();