Path: blob/master/src/applications/auth/query/PhabricatorAuthProviderConfigQuery.php
12256 views
<?php12final class PhabricatorAuthProviderConfigQuery3extends PhabricatorCursorPagedPolicyAwareQuery {45private $ids;6private $phids;7private $providerClasses;8private $isEnabled;910public function withPHIDs(array $phids) {11$this->phids = $phids;12return $this;13}1415public function withIDs(array $ids) {16$this->ids = $ids;17return $this;18}1920public function withProviderClasses(array $classes) {21$this->providerClasses = $classes;22return $this;23}2425public function withIsEnabled($is_enabled) {26$this->isEnabled = $is_enabled;27return $this;28}2930public function newResultObject() {31return new PhabricatorAuthProviderConfig();32}3334protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {35$where = parent::buildWhereClauseParts($conn);3637if ($this->ids !== null) {38$where[] = qsprintf(39$conn,40'id IN (%Ld)',41$this->ids);42}4344if ($this->phids !== null) {45$where[] = qsprintf(46$conn,47'phid IN (%Ls)',48$this->phids);49}5051if ($this->providerClasses !== null) {52$where[] = qsprintf(53$conn,54'providerClass IN (%Ls)',55$this->providerClasses);56}5758if ($this->isEnabled !== null) {59$where[] = qsprintf(60$conn,61'isEnabled = %d',62(int)$this->isEnabled);63}6465return $where;66}6768protected function willFilterPage(array $configs) {6970foreach ($configs as $key => $config) {71$provider = $config->getProvider();72if (!$provider) {73unset($configs[$key]);74continue;75}76}7778return $configs;79}8081public function getQueryApplicationClass() {82return 'PhabricatorAuthApplication';83}8485}868788