Page MenuHomePhorge

DiagramTransaction.php
No OneTemporary

DiagramTransaction.php

<?php
final class DiagramTransaction
extends PhabricatorModularTransaction {
const MAILTAG_CONTENT = 'diagram-content';
/**
* This method returns the name of the application associated with
* the transaction.
* It is used to determine which application the transaction belongs
* to and also what the name of the corresponding database is
*/
public function getApplicationName() {
return 'diagram';
}
/**
* This method returns the type of the transaction.
* It is used to determine the type of transaction that is being performed
*/
public function getApplicationTransactionType() {
return DiagramPHIDType::TYPECONST;
}
/**
* This method returns the base class for the transaction.
* It is used to determine the base class that the transaction extends.
*/
public function getBaseTransactionClass() {
return DiagramTransactionType::class;
}
/**
* This method returns a list of tags associated with the email notification
* for the transaction.
* It is used to determine which tags should be associated with the email
* notification for a given transaction.
*/
public function getMailTags() {
$tags = array();
return $tags;
}
/**
* This method returns a list of PHIDs that are required to handle the
* transaction.
* It is used to determine which objects are required to handle the
* transaction
*/
public function getRequiredHandlePHIDs() {
$phids = parent::getRequiredHandlePHIDs();
return $phids;
}
/**
* Shows the text in the 'Recent Activity' for a Diagram modification event
*/
public function getTitle() {
$author_phid = $this->getAuthorPHID();
$author_handle = $this->getHandle($author_phid);
$diagram = $this->getObject();
$first_version = $diagram->getNumberOfVersions() == 1;
$author_link = phutil_tag(
'a',
array(
'href' => $author_handle->getURI(),
'class' => 'phui-handle phui-link-person',
),
$author_handle->getName()
);
$diagram_link = phutil_tag(
'a',
array(
'href' => $diagram->getViewURI(),
),
$diagram->getMonogram()
);
if ($this->transactionType == "core:subscribers") {
// subscription changed
if (empty($this->newValue)) {
return pht('%s unsubscribed from %s %s.',
$author_link,
$diagram->getApplicationName(),
$diagram_link);
} else {
return pht('%s subscribed to %s %s.',
$author_link,
$diagram->getApplicationName(),
$diagram_link);
}
} else {
if ($this->transactionType == "content") {
// content changed
if ($first_version) {
return pht('%s created %s %s.',
$author_link,
$diagram->getApplicationName(),
$diagram_link);
} else {
return pht('%s edited %s %s.',
$author_link,
$diagram->getApplicationName(),
$diagram_link);
}
}
}
// some unknown action was executed
return pht('%s did something to %s %s.',
$author_link,
$diagram->getApplicationName(),
$diagram_link);
}
/**
* This method determines whether the transaction should be hidden in email
* notifications.
*/
public function shouldHideForMail(array $xactions) {
return false;
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Jan 19, 12:31 (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1124594
Default Alt Text
DiagramTransaction.php (3 KB)

Event Timeline