Page MenuHomePhorge

HeraldRuleEditor.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

HeraldRuleEditor.php

<?php
final class HeraldRuleEditor
extends PhabricatorApplicationTransactionEditor {
public function getEditorApplicationClass() {
return PhabricatorHeraldApplication::class;
}
public function getEditorObjectsDescription() {
return pht('Herald Rules');
}
protected function shouldApplyHeraldRules(
PhabricatorLiskDAO $object,
array $xactions) {
return true;
}
protected function buildHeraldAdapter(
PhabricatorLiskDAO $object,
array $xactions) {
return id(new HeraldRuleAdapter())
->setRule($object);
}
protected function shouldSendMail(
PhabricatorLiskDAO $object,
array $xactions) {
return true;
}
public function getTransactionTypes() {
$types = parent::getTransactionTypes();
$types[] = PhabricatorTransactions::TYPE_EDGE;
return $types;
}
protected function getMailTo(PhabricatorLiskDAO $object) {
$phids = array();
$phids[] = $this->getActingAsPHID();
if ($object->isPersonalRule()) {
$phids[] = $object->getAuthorPHID();
}
return $phids;
}
protected function buildReplyHandler(PhabricatorLiskDAO $object) {
return id(new HeraldRuleReplyHandler())
->setMailReceiver($object);
}
protected function buildMailTemplate(PhabricatorLiskDAO $object) {
$monogram = $object->getMonogram();
$name = $object->getName();
$subject = pht('%s: %s', $monogram, $name);
return id(new PhabricatorMetaMTAMail())
->setSubject($subject);
}
protected function getMailSubjectPrefix() {
return pht('[Herald]');
}
protected function buildMailBody(
PhabricatorLiskDAO $object,
array $xactions) {
$body = parent::buildMailBody($object, $xactions);
$body->addLinkSection(
pht('RULE DETAIL'),
PhabricatorEnv::getProductionURI($object->getURI()));
return $body;
}
protected function supportsSearch() {
return true;
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, May 12, 4:35 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
121393
Default Alt Text
HeraldRuleEditor.php (1 KB)

Event Timeline