Differential D19443 Diff 46541 src/applications/diffusion/query/DiffusionRepositoryIdentitySearchEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/query/DiffusionRepositoryIdentitySearchEngine.php
Show All 11 Lines | final class DiffusionRepositoryIdentitySearchEngine | ||||
} | } | ||||
public function newQuery() { | public function newQuery() { | ||||
return new PhabricatorRepositoryIdentityQuery(); | return new PhabricatorRepositoryIdentityQuery(); | ||||
} | } | ||||
protected function buildCustomSearchFields() { | protected function buildCustomSearchFields() { | ||||
return array( | return array( | ||||
id(new DiffusionIdentityAssigneeSearchField()) | |||||
->setLabel(pht('Assigned To')) | |||||
->setKey('assignee') | |||||
->setDescription(pht('Search for identities by assignee.')), | |||||
id(new PhabricatorSearchTextField()) | |||||
->setLabel(pht('Identity Contains')) | |||||
->setKey('match') | |||||
->setDescription(pht('Search for identities by substring.')), | |||||
id(new PhabricatorSearchThreeStateField()) | id(new PhabricatorSearchThreeStateField()) | ||||
->setLabel(pht('Is Assigned')) | ->setLabel(pht('Is Assigned')) | ||||
->setKey('hasEffectivePHID') | ->setKey('hasEffectivePHID') | ||||
->setOptions( | ->setOptions( | ||||
pht('(Show All)'), | pht('(Show All)'), | ||||
pht('Show Only Assigned Identities'), | pht('Show Only Assigned Identities'), | ||||
pht('Show Only Unassigned Identities')), | pht('Show Only Unassigned Identities')), | ||||
); | ); | ||||
} | } | ||||
protected function buildQueryFromParameters(array $map) { | protected function buildQueryFromParameters(array $map) { | ||||
$query = $this->newQuery(); | $query = $this->newQuery(); | ||||
if ($map['hasEffectivePHID'] !== null) { | if ($map['hasEffectivePHID'] !== null) { | ||||
$query->withHasEffectivePHID($map['hasEffectivePHID']); | $query->withHasEffectivePHID($map['hasEffectivePHID']); | ||||
} | } | ||||
if ($map['match'] !== null) { | |||||
$query->withIdentityNameLike($map['match']); | |||||
} | |||||
if ($map['assignee']) { | |||||
$query->withAssigneePHIDs($map['assignee']); | |||||
} | |||||
return $query; | return $query; | ||||
} | } | ||||
protected function getURI($path) { | protected function getURI($path) { | ||||
return '/diffusion/identity/'.$path; | return '/diffusion/identity/'.$path; | ||||
} | } | ||||
protected function getBuiltinQueryNames() { | protected function getBuiltinQueryNames() { | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |