Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/query/PhabricatorFileSearchEngine.php
| Show All 11 Lines | final class PhabricatorFileSearchEngine | ||||
| } | } | ||||
| public function newQuery() { | public function newQuery() { | ||||
| return new PhabricatorFileQuery(); | return new PhabricatorFileQuery(); | ||||
| } | } | ||||
| protected function buildCustomSearchFields() { | protected function buildCustomSearchFields() { | ||||
| return array( | return array( | ||||
| id(new PhabricatorSearchTextField()) | |||||
| ->setKey('name') | |||||
| ->setLabel(pht('Name')), | |||||
| 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()) | ||||
| ->setKey('explicit') | ->setKey('explicit') | ||||
| ->setLabel(pht('Upload Source')) | ->setLabel(pht('Upload Source')) | ||||
| ->setOptions( | ->setOptions( | ||||
| Show All 15 Lines | return array( | ||||
| 'createdStart', | 'createdStart', | ||||
| 'createdEnd', | 'createdEnd', | ||||
| ); | ); | ||||
| } | } | ||||
| protected function buildQueryFromParameters(array $map) { | protected function buildQueryFromParameters(array $map) { | ||||
| $query = $this->newQuery(); | $query = $this->newQuery(); | ||||
| if ($map['name']) { | |||||
| $query->withNames(array($map['name'])); | |||||
| } | |||||
| if ($map['authorPHIDs']) { | if ($map['authorPHIDs']) { | ||||
| $query->withAuthorPHIDs($map['authorPHIDs']); | $query->withAuthorPHIDs($map['authorPHIDs']); | ||||
| } | } | ||||
| if ($map['explicit'] !== null) { | if ($map['explicit'] !== null) { | ||||
| $query->showOnlyExplicitUploads($map['explicit']); | $query->showOnlyExplicitUploads($map['explicit']); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines | |||||