Path: blob/master/src/applications/auth/query/PhabricatorExternalAccountIdentifierQuery.php
12256 views
<?php12final class PhabricatorExternalAccountIdentifierQuery3extends PhabricatorCursorPagedPolicyAwareQuery {45private $ids;6private $phids;7private $providerConfigPHIDs;8private $externalAccountPHIDs;9private $rawIdentifiers;1011public function withIDs($ids) {12$this->ids = $ids;13return $this;14}1516public function withPHIDs(array $phids) {17$this->phids = $phids;18return $this;19}2021public function withProviderConfigPHIDs(array $phids) {22$this->providerConfigPHIDs = $phids;23return $this;24}2526public function withExternalAccountPHIDs(array $phids) {27$this->externalAccountPHIDs = $phids;28return $this;29}3031public function withRawIdentifiers(array $identifiers) {32$this->rawIdentifiers = $identifiers;33return $this;34}3536public function newResultObject() {37return new PhabricatorExternalAccountIdentifier();38}3940protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {41$where = parent::buildWhereClauseParts($conn);4243if ($this->ids !== null) {44$where[] = qsprintf(45$conn,46'id IN (%Ld)',47$this->ids);48}4950if ($this->phids !== null) {51$where[] = qsprintf(52$conn,53'phid IN (%Ls)',54$this->phids);55}5657if ($this->providerConfigPHIDs !== null) {58$where[] = qsprintf(59$conn,60'providerConfigPHID IN (%Ls)',61$this->providerConfigPHIDs);62}6364if ($this->externalAccountPHIDs !== null) {65$where[] = qsprintf(66$conn,67'externalAccountPHID IN (%Ls)',68$this->externalAccountPHIDs);69}7071if ($this->rawIdentifiers !== null) {72$hashes = array();73foreach ($this->rawIdentifiers as $raw_identifier) {74$hashes[] = PhabricatorHash::digestForIndex($raw_identifier);75}76$where[] = qsprintf(77$conn,78'identifierHash IN (%Ls)',79$hashes);80}8182return $where;83}8485public function getQueryApplicationClass() {86return 'PhabricatorPeopleApplication';87}8889}909192