Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/typeahead/PhabricatorPeopleDatasource.php
Show All 11 Lines | final class PhabricatorPeopleDatasource | ||||
} | } | ||||
public function getDatasourceApplicationClass() { | public function getDatasourceApplicationClass() { | ||||
return 'PhabricatorPeopleApplication'; | return 'PhabricatorPeopleApplication'; | ||||
} | } | ||||
public function loadResults() { | public function loadResults() { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$tokens = $this->getTokens(); | |||||
$query = id(new PhabricatorPeopleQuery()) | $query = id(new PhabricatorPeopleQuery()) | ||||
->setOrderVector(array('username')); | ->setOrderVector(array('username')); | ||||
if ($this->getPhase() == self::PHASE_PREFIX) { | |||||
$prefix = $this->getPrefixQuery(); | |||||
$query->withNamePrefixes(array($prefix)); | |||||
} else { | |||||
$tokens = $this->getTokens(); | |||||
if ($tokens) { | if ($tokens) { | ||||
$query->withNameTokens($tokens); | $query->withNameTokens($tokens); | ||||
} | } | ||||
} | |||||
$users = $this->executeQuery($query); | $users = $this->executeQuery($query); | ||||
$is_browse = $this->getIsBrowse(); | $is_browse = $this->getIsBrowse(); | ||||
if ($is_browse && $users) { | if ($is_browse && $users) { | ||||
$phids = mpull($users, 'getPHID'); | $phids = mpull($users, 'getPHID'); | ||||
$handles = id(new PhabricatorHandleQuery()) | $handles = id(new PhabricatorHandleQuery()) | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |