Path: blob/master/src/applications/auth/query/PhabricatorAuthChallengeQuery.php
12262 views
<?php12final class PhabricatorAuthChallengeQuery3extends PhabricatorCursorPagedPolicyAwareQuery {45private $ids;6private $phids;7private $userPHIDs;8private $factorPHIDs;9private $challengeTTLMin;10private $challengeTTLMax;1112public function withIDs(array $ids) {13$this->ids = $ids;14return $this;15}1617public function withPHIDs(array $phids) {18$this->phids = $phids;19return $this;20}2122public function withUserPHIDs(array $user_phids) {23$this->userPHIDs = $user_phids;24return $this;25}2627public function withFactorPHIDs(array $factor_phids) {28$this->factorPHIDs = $factor_phids;29return $this;30}3132public function withChallengeTTLBetween($challenge_min, $challenge_max) {33$this->challengeTTLMin = $challenge_min;34$this->challengeTTLMax = $challenge_max;35return $this;36}3738public function newResultObject() {39return new PhabricatorAuthChallenge();40}4142protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {43$where = parent::buildWhereClauseParts($conn);4445if ($this->ids !== null) {46$where[] = qsprintf(47$conn,48'id IN (%Ld)',49$this->ids);50}5152if ($this->phids !== null) {53$where[] = qsprintf(54$conn,55'phid IN (%Ls)',56$this->phids);57}5859if ($this->userPHIDs !== null) {60$where[] = qsprintf(61$conn,62'userPHID IN (%Ls)',63$this->userPHIDs);64}6566if ($this->factorPHIDs !== null) {67$where[] = qsprintf(68$conn,69'factorPHID IN (%Ls)',70$this->factorPHIDs);71}7273if ($this->challengeTTLMin !== null) {74$where[] = qsprintf(75$conn,76'challengeTTL >= %d',77$this->challengeTTLMin);78}7980if ($this->challengeTTLMax !== null) {81$where[] = qsprintf(82$conn,83'challengeTTL <= %d',84$this->challengeTTLMax);85}8687return $where;88}8990public function getQueryApplicationClass() {91return 'PhabricatorAuthApplication';92}9394}959697