Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/query/PhabricatorPeopleQuery.php
| <?php | <?php | ||||
| final class PhabricatorPeopleQuery | final class PhabricatorPeopleQuery | ||||
| extends PhabricatorCursorPagedPolicyAwareQuery { | extends PhabricatorCursorPagedPolicyAwareQuery { | ||||
| private $usernames; | private $usernames; | ||||
| private $realnames; | private $realnames; | ||||
| private $emails; | private $emails; | ||||
| private $phids; | private $phids; | ||||
| private $ids; | private $ids; | ||||
| private $dateCreatedAfter; | private $dateCreatedAfter; | ||||
| private $dateCreatedBefore; | private $dateCreatedBefore; | ||||
| private $isAdmin; | private $isAdmin; | ||||
| private $isSystemAgent; | private $isSystemAgent; | ||||
| private $isMailingList; | |||||
| private $isDisabled; | private $isDisabled; | ||||
| private $isApproved; | private $isApproved; | ||||
| private $nameLike; | private $nameLike; | ||||
| private $nameTokens; | private $nameTokens; | ||||
| private $needPrimaryEmail; | private $needPrimaryEmail; | ||||
| private $needProfile; | private $needProfile; | ||||
| private $needProfileImage; | private $needProfileImage; | ||||
| Show All 39 Lines | public function withIsAdmin($admin) { | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withIsSystemAgent($system_agent) { | public function withIsSystemAgent($system_agent) { | ||||
| $this->isSystemAgent = $system_agent; | $this->isSystemAgent = $system_agent; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withIsMailingList($mailing_list) { | |||||
| $this->isMailingList = $mailing_list; | |||||
| return $this; | |||||
| } | |||||
| public function withIsDisabled($disabled) { | public function withIsDisabled($disabled) { | ||||
| $this->isDisabled = $disabled; | $this->isDisabled = $disabled; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withIsApproved($approved) { | public function withIsApproved($approved) { | ||||
| $this->isApproved = $approved; | $this->isApproved = $approved; | ||||
| return $this; | return $this; | ||||
| ▲ Show 20 Lines • Show All 257 Lines • ▼ Show 20 Lines | protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | ||||
| if ($this->isSystemAgent !== null) { | if ($this->isSystemAgent !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn_r, | ||||
| 'user.isSystemAgent = %d', | 'user.isSystemAgent = %d', | ||||
| (int)$this->isSystemAgent); | (int)$this->isSystemAgent); | ||||
| } | } | ||||
| if ($this->isMailingList !== null) { | |||||
| $where[] = qsprintf( | |||||
| $conn_r, | |||||
| 'user.isMailingList = %d', | |||||
| (int)$this->isMailingList); | |||||
| } | |||||
| if (strlen($this->nameLike)) { | if (strlen($this->nameLike)) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn_r, | ||||
| 'user.username LIKE %~ OR user.realname LIKE %~', | 'user.username LIKE %~ OR user.realname LIKE %~', | ||||
| $this->nameLike, | $this->nameLike, | ||||
| $this->nameLike); | $this->nameLike); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 108 Lines • Show Last 20 Lines | |||||