Returns a list of providers, optionally filtered by availability

@param  string $status The filter to apply

@return array
185792
public function getProviders($status = null)
    {
        if ($status == 'ENABLED') {
            return $this->aProviders['enabled'];
        } elseif ($status == 'DISABLED') {
            return $this->aProviders['disabled'];
        } else {
            return $this->aProviders['all'];
        }
    }
912428
public function status($status)
    {
        if (!$this->statusIsNullable || $status !== null) {
            Checkers::checkStatus($status, null);
        }
        $this->status = $status;
        return $this;
    }
1078036
public static function getStatusList()
    {
        return [
            self::STATUS_OK => 'ok',
            self::STATUS_SENDING => 'sending',
            self::STATUS_PENDING => 'pending',
            self::STATUS_ERROR => 'error',
            self::STATUS_ENCODING => 'encoding',
        ];
    }
562972
public function search($params, $status = null)
    {
        $order = (empty($status)) ? Order::find()->where(['user_id' => \Yii::$app->user->id])->one() :
            Order::find()->where(['user_id' => \Yii::$app->user->id, 'status' => $status])->one();

        if (!empty($order)) {
            $query = OrderProduct::find();

            // add conditions that should always apply here

            $dataProvider = new ActiveDataProvider([
                'query' => $query,
            ]);

            $this->load($params);

            if (!$this->validate()) {
                // uncomment the following line if you do not want to return any records when validation fails
                // $query->where('0=1');
                return $dataProvider;
            }

            // grid filtering conditions
            $query->andFilterWhere([
                'id' => $this->id,
                'product_id' => $this->product_id,
                'order_id' => $order->id,
                'count' => $this->count,
            ]);

            return $dataProvider;
        }


    }
160169
public function listCustomers($parameters = [])
    {
        $response = $this->client->get('customers', [
            'query' => $parameters,
        ]);
        return json_decode($response->getBody())->customers;
    }
343046
public function getStatusAsString($status)
    {
        $options = self::getStatusOptions();
        return isset($options[$status]) ? $options[$status] : '';
    }
962348
public function statusExist($status)
    {
        $generator = $this->getStatuses();
        $list = iterator_to_array($generator);

        return in_array($status, $list);
    }
890987
def list_service_providers(self, retrieve_all=True, **_params):
        """"""
        # Pass filters in "params" argument to do_request
        return self.list('service_providers', self.service_providers_path,
                         retrieve_all, **_params)
1052396
public function getOrderByFilter($status = null, $begintime = null, $endtime = null){
		if (!$this->access_token && !$this->checkAuth()) return false;

		$data = array();

		$valid_status = array(2, 3, 5, 8);
		if (is_numeric($status) && in_array($status, $valid_status)) {
			$data['status'] = $status;
		}

		if (is_numeric($begintime) && is_numeric($endtime)) {
			$data['begintime'] = $begintime;
			$data['endtime'] = $endtime;
		}
		$result = $this->http_post(self::API_BASE_URL_PREFIX.self::MERCHANT_ORDER_GETBYFILTER.'access_token='.$this->access_token, self::json_encode($data));
		if ($result)
		{
			$json = json_decode($result,true);
			if (isset($json['errcode']) && $json['errcode']) {
				$this->errCode = $json['errcode'];
				$this->errMsg = $json['errmsg'];
				return false;
			}
			return $json['order_list'];
		}
		return false;
	}
1283178
protected function statusText($status)
    {
        switch ($status) {
            case EnvironmentCheck::ERROR:
                return 'ERROR';
                break;
            case EnvironmentCheck::WARNING:
                return 'WARNING';
                break;
            case EnvironmentCheck::OK:
                return 'OK';
                break;
            case 0:
                return 'NO CHECKS';
                break;
            default:
                throw new InvalidArgumentException("Bad environment check status '$status'");
                break;
        }
    }
799431
public function getFilteredQuery($status, $type)
    {
        $query = $this->createQueryBuilder('n');

        if (is_int($status) && in_array($status, NoticeEntity::getStatuses())) {
            $query
                ->where('n.status = :status')
                ->setParameter('status', $status);
        }

        if ($type) {
            $query
                ->andWhere('n.type = :type')
                ->setParameter('type', $type);
        }

        return $query;
    }
33598
public static function modules($status = 'installed') {
        switch ($status) {
            case 'uninstalled':
                $modules = array_filter(self::$modules, function (Module $m) {
                    return !$m->installed;
                });
                break;
            case 'installed':
                $modules = array_filter(self::$modules, function (Module $m) {
                    return $m->installed;
                });
                break;
            case 'enabled':
                $modules = array_filter(self::$modules, function (Module $m) {
                    return $m->enabled;
                });
                break;
            case 'disabled':
                $modules = array_filter(self::$modules, function (Module $m) {
                    return !$m->enabled && $m->installed;
                });
                break;
            case 'upgradable':
                $modules = array_filter(self::$modules, function (Module $m) {
                    return $m->upgradable && $m->installed;
                });
                break;
            default:
                $modules = self::$modules;
                break;
        }

        return $modules;
    }
215540
public function getUser($status = User::STATUS_ACTIVE)
    {
        if ($this->_user === false) {
            $this->_user = User::findByKeyfield($this->username, $status);
        }
        return $this->_user;
    }
1022511
public function status($status = null)
    {
        if (!is_null($status)) {
            $this->status = (int) $status;
        }

        return $this->status;
    }
354147
public function getStatuses()
    {
        return [
            self::STATUS_PENDING,
            self::STATUS_PROCESSING,
            self::STATUS_COMPLETE,
            self::STATUS_FAILED,
            self::STATUS_REFUNDED,
            self::STATUS_REFUNDED_PARTIAL,
        ];
    }
1345899
public function status($status = null) {
			if ($status != null) {
				if (array_key_exists($status, $this->_statusCode)) {
					$this->_status = $status;
				}

				return true;
			}
			else {
				return $this->_status;
			}
		}
1282795
protected function filterStatus($status)
    {
        if (!is_integer($status) ||
            $status<StatusCode::HTTP_CONTINUE ||
            $status>StatusCode::HTTP_NETWORK_CONNECTION_TIMEOUT_ERROR
        ) {
            throw new InvalidArgumentException('Invalid HTTP status code');
        }

        return $status;
    }