mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-16 03:42:41 +01:00
46 lines
1,002 B
PHP
46 lines
1,002 B
PHP
|
<?php
|
||
|
|
||
|
final class AlmanacNetworkTransaction
|
||
|
extends PhabricatorApplicationTransaction {
|
||
|
|
||
|
const TYPE_NAME = 'almanac:network:name';
|
||
|
|
||
|
public function getApplicationName() {
|
||
|
return 'almanac';
|
||
|
}
|
||
|
|
||
|
public function getApplicationTransactionType() {
|
||
|
return AlmanacNetworkPHIDType::TYPECONST;
|
||
|
}
|
||
|
|
||
|
public function getApplicationTransactionCommentObject() {
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
public function getTitle() {
|
||
|
$author_phid = $this->getAuthorPHID();
|
||
|
|
||
|
$old = $this->getOldValue();
|
||
|
$new = $this->getNewValue();
|
||
|
|
||
|
switch ($this->getTransactionType()) {
|
||
|
case self::TYPE_NAME:
|
||
|
if ($old === null) {
|
||
|
return pht(
|
||
|
'%s created this network.',
|
||
|
$this->renderHandleLink($author_phid));
|
||
|
} else {
|
||
|
return pht(
|
||
|
'%s renamed this network from "%s" to "%s".',
|
||
|
$this->renderHandleLink($author_phid),
|
||
|
$old,
|
||
|
$new);
|
||
|
}
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
return parent::getTitle();
|
||
|
}
|
||
|
|
||
|
}
|