Differential D14846 Diff 35881 src/applications/owners/query/PhabricatorOwnersPackageSearchEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/owners/query/PhabricatorOwnersPackageSearchEngine.php
Show All 19 Lines | return array( | ||||
id(new PhabricatorSearchDatasourceField()) | id(new PhabricatorSearchDatasourceField()) | ||||
->setLabel(pht('Authority')) | ->setLabel(pht('Authority')) | ||||
->setKey('authorityPHIDs') | ->setKey('authorityPHIDs') | ||||
->setAliases(array('authority', 'authorities')) | ->setAliases(array('authority', 'authorities')) | ||||
->setConduitKey('owners') | ->setConduitKey('owners') | ||||
->setDescription( | ->setDescription( | ||||
pht('Search for packages with specific owners.')) | pht('Search for packages with specific owners.')) | ||||
->setDatasource(new PhabricatorProjectOrUserDatasource()), | ->setDatasource(new PhabricatorProjectOrUserDatasource()), | ||||
id(new PhabricatorSearchTextField()) | |||||
->setLabel(pht('Name Contains')) | |||||
->setKey('name') | |||||
->setDescription(pht('Search for packages by name substrings.')), | |||||
id(new PhabricatorSearchDatasourceField()) | id(new PhabricatorSearchDatasourceField()) | ||||
->setLabel(pht('Repositories')) | ->setLabel(pht('Repositories')) | ||||
->setKey('repositoryPHIDs') | ->setKey('repositoryPHIDs') | ||||
->setConduitKey('repositories') | ->setConduitKey('repositories') | ||||
->setAliases(array('repository', 'repositories')) | ->setAliases(array('repository', 'repositories')) | ||||
->setDescription( | ->setDescription( | ||||
pht('Search for packages by included repositories.')) | pht('Search for packages by included repositories.')) | ||||
->setDatasource(new DiffusionRepositoryDatasource()), | ->setDatasource(new DiffusionRepositoryDatasource()), | ||||
Show All 28 Lines | protected function buildQueryFromParameters(array $map) { | ||||
if ($map['paths']) { | if ($map['paths']) { | ||||
$query->withPaths($map['paths']); | $query->withPaths($map['paths']); | ||||
} | } | ||||
if ($map['statuses']) { | if ($map['statuses']) { | ||||
$query->withStatuses($map['statuses']); | $query->withStatuses($map['statuses']); | ||||
} | } | ||||
if (strlen($map['name'])) { | |||||
$query->withNameNgrams($map['name']); | |||||
} | |||||
return $query; | return $query; | ||||
} | } | ||||
protected function getURI($path) { | protected function getURI($path) { | ||||
return '/owners/'.$path; | return '/owners/'.$path; | ||||
} | } | ||||
protected function getBuiltinQueryNames() { | protected function getBuiltinQueryNames() { | ||||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |