1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-28 14:39:36 +01:00
phorge-phorge/src/applications/search/field/PhabricatorSearchSubscribersField.php
epriestley 2951e0c86b Include owners packages in the MailableFunction datasource
Summary:
Ref T13151. See PHI684. Currently, the `MailableFunction` datasource does not include Owners packages, but they are valid subscribers and the `Mailable` datasource includes them.

Include them in the `MailableFunction` datasource, too.

Test Plan: Searched for revisions with particular package subscribers, got expected results in the UI (tokenizer knew about packages) and response.

Reviewers: amckinley, jmeador

Reviewed By: jmeador

Maniphest Tasks: T13151

Differential Revision: https://secure.phabricator.com/D19476
2018-06-07 12:02:50 -07:00

28 lines
766 B
PHP

<?php
final class PhabricatorSearchSubscribersField
extends PhabricatorSearchTokenizerField {
protected function getDefaultValue() {
return array();
}
protected function getValueFromRequest(AphrontRequest $request, $key) {
$allow_types = array(
PhabricatorProjectProjectPHIDType::TYPECONST,
PhabricatorOwnersPackagePHIDType::TYPECONST,
);
return $this->getUsersFromRequest($request, $key, $allow_types);
}
protected function newDatasource() {
return new PhabricatorMetaMTAMailableFunctionDatasource();
}
protected function newConduitParameterType() {
// TODO: Ideally, this should eventually be a "Subscribers" type which
// accepts projects as well.
return new ConduitUserListParameterType();
}
}