Add loadObject() methods to PhabricatorObjectMailReceiver subclasses
Summary: This doesn't do anything, but touches a bunch of files so I split it out to reduce the size of the next diff. Basically, make `MailReceiver` classes responsible for loading their application objects. Ref T1205. Test Plan: Inspection / next diff / code is not reached. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T1205 Differential Revision: https://secure.phabricator.com/D5941
This commit is contained in:
@@ -11,4 +11,14 @@ final class PhabricatorMacroMailReceiver extends PhabricatorObjectMailReceiver {
|
||||
return 'MCRO[1-9]\d*';
|
||||
}
|
||||
|
||||
|
||||
protected function loadObject($pattern, PhabricatorUser $viewer) {
|
||||
$id = (int)substr($pattern, 4);
|
||||
|
||||
return id(new PhabricatorMacroQuery())
|
||||
->setViewer($viewer)
|
||||
->withIDs(array($id))
|
||||
->executeOne();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user