Differential D15876 Diff 38258 src/applications/repository/query/PhabricatorRepositorySearchEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/query/PhabricatorRepositorySearchEngine.php
Show All 32 Lines | return array( | ||||
id(new PhabricatorSearchSelectField()) | id(new PhabricatorSearchSelectField()) | ||||
->setLabel(pht('Hosted')) | ->setLabel(pht('Hosted')) | ||||
->setKey('hosted') | ->setKey('hosted') | ||||
->setOptions($this->getHostedOptions()), | ->setOptions($this->getHostedOptions()), | ||||
id(new PhabricatorSearchCheckboxesField()) | id(new PhabricatorSearchCheckboxesField()) | ||||
->setLabel(pht('Types')) | ->setLabel(pht('Types')) | ||||
->setKey('types') | ->setKey('types') | ||||
->setOptions(PhabricatorRepositoryType::getAllRepositoryTypes()), | ->setOptions(PhabricatorRepositoryType::getAllRepositoryTypes()), | ||||
id(new PhabricatorSearchStringListField()) | |||||
->setLabel(pht('URIs')) | |||||
->setKey('uris') | |||||
->setDescription( | |||||
pht('Search for repositories by clone/checkout URI.')), | |||||
); | ); | ||||
} | } | ||||
protected function buildQueryFromParameters(array $map) { | protected function buildQueryFromParameters(array $map) { | ||||
$query = $this->newQuery(); | $query = $this->newQuery(); | ||||
if ($map['callsigns']) { | if ($map['callsigns']) { | ||||
$query->withCallsigns($map['callsigns']); | $query->withCallsigns($map['callsigns']); | ||||
Show All 16 Lines | protected function buildQueryFromParameters(array $map) { | ||||
if ($map['types']) { | if ($map['types']) { | ||||
$query->withTypes($map['types']); | $query->withTypes($map['types']); | ||||
} | } | ||||
if (strlen($map['name'])) { | if (strlen($map['name'])) { | ||||
$query->withNameContains($map['name']); | $query->withNameContains($map['name']); | ||||
} | } | ||||
if ($map['uris']) { | |||||
$query->withURIs($map['uris']); | |||||
} | |||||
return $query; | return $query; | ||||
} | } | ||||
protected function getURI($path) { | protected function getURI($path) { | ||||
return '/diffusion/'.$path; | return '/diffusion/'.$path; | ||||
} | } | ||||
protected function getBuiltinQueryNames() { | protected function getBuiltinQueryNames() { | ||||
▲ Show 20 Lines • Show All 183 Lines • Show Last 20 Lines |