3 final class PhabricatorPeopleUserEmailQuery
4 extends PhabricatorCursorPagedPolicyAwareQuery
{
9 public function withIDs(array $ids) {
14 public function withPHIDs(array $phids) {
15 $this->phids
= $phids;
19 public function newResultObject() {
20 return new PhabricatorUserEmail();
23 protected function loadPage() {
24 return $this->loadStandardPage($this->newResultObject());
27 protected function getPrimaryTableAlias() {
31 protected function buildWhereClauseParts(AphrontDatabaseConnection
$conn) {
32 $where = parent
::buildWhereClauseParts($conn);
34 if ($this->ids
!== null) {
41 if ($this->phids
!== null) {
44 'email.phid IN (%Ls)',
51 protected function willLoadPage(array $page) {
53 $user_phids = mpull($page, 'getUserPHID');
55 $users = id(new PhabricatorPeopleQuery())
56 ->setViewer($this->getViewer())
57 ->setParentQuery($this)
58 ->withPHIDs($user_phids)
60 $users = mpull($users, null, 'getPHID');
62 foreach ($page as $key => $address) {
63 $user = idx($users, $address->getUserPHID());
67 $this->didRejectResult($address);
71 $address->attachUser($user);
77 public function getQueryApplicationClass() {
78 return 'PhabricatorPeopleApplication';