Differential D14029 Diff 33931 src/applications/owners/typeahead/PhabricatorOwnersPackageOwnerDatasource.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/owners/typeahead/PhabricatorOwnersPackageOwnerDatasource.php
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | protected function evaluateFunction($function, array $argv_list) { | ||||
$phids = array(); | $phids = array(); | ||||
foreach ($argv_list as $argv) { | foreach ($argv_list as $argv) { | ||||
$phids[] = head($argv); | $phids[] = head($argv); | ||||
} | } | ||||
$phids = $this->resolvePHIDs($phids); | $phids = $this->resolvePHIDs($phids); | ||||
$user_phids = array(); | $user_phids = array(); | ||||
foreach ($phids as $phid) { | foreach ($phids as $key => $phid) { | ||||
if (phid_get_type($phid) == PhabricatorPeopleUserPHIDType::TYPECONST) { | if (phid_get_type($phid) == PhabricatorPeopleUserPHIDType::TYPECONST) { | ||||
$user_phids[] = $phid; | $user_phids[] = $phid; | ||||
unset($phids[$key]); | |||||
} | } | ||||
} | } | ||||
if ($user_phids) { | if ($user_phids) { | ||||
$projects = id(new PhabricatorProjectQuery()) | $packages = id(new PhabricatorOwnersPackageQuery()) | ||||
->setViewer($this->getViewer()) | ->setViewer($this->getViewer()) | ||||
->withMemberPHIDs($user_phids) | ->withOwnerPHIDs($user_phids) | ||||
->execute(); | ->execute(); | ||||
foreach ($projects as $project) { | foreach ($packages as $package) { | ||||
$phids[] = $project->getPHID(); | $phids[] = $package->getPHID(); | ||||
} | } | ||||
} | } | ||||
return $phids; | return $phids; | ||||
} | } | ||||
public function renderFunctionTokens($function, array $argv_list) { | public function renderFunctionTokens($function, array $argv_list) { | ||||
$phids = array(); | $phids = array(); | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |