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