Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/query/PhabricatorFileSearchEngine.php
Show All 9 Lines | final class PhabricatorFileSearchEngine | ||||
public function getApplicationClassName() { | public function getApplicationClassName() { | ||||
return 'PhabricatorFilesApplication'; | return 'PhabricatorFilesApplication'; | ||||
} | } | ||||
public function canUseInPanelContext() { | public function canUseInPanelContext() { | ||||
return false; | return false; | ||||
} | } | ||||
public function newQuery() { | public function newQuery() { | ||||
return new PhabricatorFileQuery(); | $query = new PhabricatorFileQuery(); | ||||
$query->withIsDeleted(false); | |||||
return $query; | |||||
} | } | ||||
epriestley: In this case, sliiiightly cleaner to put the `withIsDeleted()` ("global query stuff") here… | |||||
protected function buildCustomSearchFields() { | protected function buildCustomSearchFields() { | ||||
return array( | return array( | ||||
id(new PhabricatorUsersSearchField()) | id(new PhabricatorUsersSearchField()) | ||||
->setKey('authorPHIDs') | ->setKey('authorPHIDs') | ||||
->setAliases(array('author', 'authors')) | ->setAliases(array('author', 'authors')) | ||||
->setLabel(pht('Authors')), | ->setLabel(pht('Authors')), | ||||
id(new PhabricatorSearchThreeStateField()) | id(new PhabricatorSearchThreeStateField()) | ||||
▲ Show 20 Lines • Show All 184 Lines • Show Last 20 Lines |
In this case, sliiiightly cleaner to put the withIsDeleted() ("global query stuff") here instead of in buildQueryFromParameters() ("per-query custom stuff"). I don't think it matters much, but a few callsites do call newQuery() without threading the query through buildQueryFromParameters().