Changeset View
Changeset View
Standalone View
Standalone View
src/applications/tokens/mail/PhabricatorTokensMailReceiver.php
- This file was added.
| <?php | |||||
| final class PhabricatorTokensMailReceiver | |||||
| extends PhabricatorObjectMailReceiver { | |||||
| public function isEnabled() { | |||||
| return PhabricatorApplication::isClassInstalled( | |||||
| 'PhabricatorTokensApplication'); | |||||
| } | |||||
| protected function getObjectPattern() { | |||||
| return 'TOKN[1-9]\d*'; | |||||
| } | |||||
| protected function loadObject($pattern, PhabricatorUser $viewer) { | |||||
| $id = (int)substr($pattern, 4); | |||||
| return id(new PhabricatorTokenQuery()) | |||||
| ->setViewer($viewer) | |||||
| ->withIDs(array($id)) | |||||
| ->executeOne(); | |||||
| } | |||||
| protected function getTransactionReplyHandler() { | |||||
| return new PhabricatorTokensReplyHandler(); | |||||
| } | |||||
| } | |||||