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:
epriestley
2013-05-17 03:47:46 -07:00
parent 4ba86e7205
commit bb0a39a48c
9 changed files with 95 additions and 0 deletions

View File

@@ -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();
}
}