Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/mail/ManiphestTaskMailReceiver.php
| <?php | <?php | ||||
| final class ManiphestTaskMailReceiver extends PhabricatorObjectMailReceiver { | final class ManiphestTaskMailReceiver extends PhabricatorObjectMailReceiver { | ||||
| public function isEnabled() { | public function isEnabled() { | ||||
| return PhabricatorApplication::isClassInstalled( | return PhabricatorApplication::isClassInstalled( | ||||
| 'PhabricatorManiphestApplication'); | 'PhabricatorManiphestApplication'); | ||||
| } | } | ||||
| protected function getObjectPattern() { | protected function getObjectPattern() { | ||||
| return 'T[1-9]\d*'; | return 'T[1-9]\d*'; | ||||
| } | } | ||||
| protected function loadObject($pattern, PhabricatorUser $viewer) { | protected function loadObject($pattern, PhabricatorUser $viewer) { | ||||
| $id = (int)trim($pattern, 'T'); | $id = (int)trim($pattern, 'T'); | ||||
| $results = id(new ManiphestTaskQuery()) | return id(new ManiphestTaskQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->withIDs(array($id)) | ->withIDs(array($id)) | ||||
| ->needSubscriberPHIDs(true) | ->needSubscriberPHIDs(true) | ||||
| ->needProjectPHIDs(true) | ->needProjectPHIDs(true) | ||||
| ->execute(); | ->executeOne(); | ||||
| return head($results); | |||||
| } | } | ||||
| protected function getTransactionReplyHandler() { | protected function getTransactionReplyHandler() { | ||||
| return new ManiphestReplyHandler(); | return new ManiphestReplyHandler(); | ||||
| } | } | ||||
| } | } | ||||