Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/query/PhabricatorAuthContactNumberQuery.php
| <?php | <?php | ||||
| final class PhabricatorAuthContactNumberQuery | final class PhabricatorAuthContactNumberQuery | ||||
| extends PhabricatorCursorPagedPolicyAwareQuery { | extends PhabricatorCursorPagedPolicyAwareQuery { | ||||
| private $ids; | private $ids; | ||||
| private $phids; | private $phids; | ||||
| private $objectPHIDs; | private $objectPHIDs; | ||||
| private $statuses; | private $statuses; | ||||
| private $uniqueKeys; | private $uniqueKeys; | ||||
| private $isPrimary; | |||||
| public function withIDs(array $ids) { | public function withIDs(array $ids) { | ||||
| $this->ids = $ids; | $this->ids = $ids; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withPHIDs(array $phids) { | public function withPHIDs(array $phids) { | ||||
| $this->phids = $phids; | $this->phids = $phids; | ||||
| Show All 10 Lines | public function withStatuses(array $statuses) { | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withUniqueKeys(array $unique_keys) { | public function withUniqueKeys(array $unique_keys) { | ||||
| $this->uniqueKeys = $unique_keys; | $this->uniqueKeys = $unique_keys; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withIsPrimary($is_primary) { | |||||
| $this->isPrimary = $is_primary; | |||||
| return $this; | |||||
| } | |||||
| public function newResultObject() { | public function newResultObject() { | ||||
| return new PhabricatorAuthContactNumber(); | return new PhabricatorAuthContactNumber(); | ||||
| } | } | ||||
| protected function loadPage() { | protected function loadPage() { | ||||
| return $this->loadStandardPage($this->newResultObject()); | return $this->loadStandardPage($this->newResultObject()); | ||||
| } | } | ||||
| Show All 30 Lines | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
| if ($this->uniqueKeys !== null) { | if ($this->uniqueKeys !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn, | $conn, | ||||
| 'uniqueKey IN (%Ls)', | 'uniqueKey IN (%Ls)', | ||||
| $this->uniqueKeys); | $this->uniqueKeys); | ||||
| } | } | ||||
| if ($this->isPrimary !== null) { | |||||
| $where[] = qsprintf( | |||||
| $conn, | |||||
| 'isPrimary = %d', | |||||
| (int)$this->isPrimary); | |||||
| } | |||||
| return $where; | return $where; | ||||
| } | } | ||||
| public function getQueryApplicationClass() { | public function getQueryApplicationClass() { | ||||
| return 'PhabricatorAuthApplication'; | return 'PhabricatorAuthApplication'; | ||||
| } | } | ||||
| } | } | ||||