Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/query/PhabricatorPeopleUserEmailQuery.php
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | if ($this->phids !== null) { | ||||
$conn, | $conn, | ||||
'email.phid IN (%Ls)', | 'email.phid IN (%Ls)', | ||||
$this->phids); | $this->phids); | ||||
} | } | ||||
return $where; | return $where; | ||||
} | } | ||||
protected function willLoadPage(array $page) { | |||||
$user_phids = mpull($page, 'getUserPHID'); | |||||
$users = id(new PhabricatorPeopleQuery()) | |||||
->setViewer($this->getViewer()) | |||||
->setParentQuery($this) | |||||
->withPHIDs($user_phids) | |||||
->execute(); | |||||
$users = mpull($users, null, 'getPHID'); | |||||
foreach ($page as $key => $address) { | |||||
$user = idx($users, $address->getUserPHID()); | |||||
if (!$user) { | |||||
unset($page[$key]); | |||||
$this->didRejectResult($address); | |||||
continue; | |||||
} | |||||
$address->attachUser($user); | |||||
} | |||||
return $page; | |||||
} | |||||
public function getQueryApplicationClass() { | public function getQueryApplicationClass() { | ||||
return 'PhabricatorPeopleApplication'; | return 'PhabricatorPeopleApplication'; | ||||
} | } | ||||
} | } |