Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/macro/mail/PhabricatorMacroMailReceiver.php
12241 views
1
<?php
2
3
final class PhabricatorMacroMailReceiver extends PhabricatorObjectMailReceiver {
4
5
public function isEnabled() {
6
return PhabricatorApplication::isClassInstalled(
7
'PhabricatorManiphestApplication');
8
}
9
10
protected function getObjectPattern() {
11
return 'MCRO[1-9]\d*';
12
}
13
14
protected function loadObject($pattern, PhabricatorUser $viewer) {
15
$id = (int)substr($pattern, 4);
16
17
return id(new PhabricatorMacroQuery())
18
->setViewer($viewer)
19
->withIDs(array($id))
20
->executeOne();
21
}
22
23
protected function getTransactionReplyHandler() {
24
return new PhabricatorMacroReplyHandler();
25
}
26
27
}
28
29