Returns status list, with or without labels.

@param bool  $withLabelsAsIndexes
@param array $filterStatus

@return array
182755
public static function getStatusList($withLabelsAsIndexes = false, array $filterStatus = null)
    {
        // Build $statusValues if this is the first call
        if (null === static::$statusValues) {
            static::$statusValues = array();
            $refClass = new \ReflectionClass(get_called_class());
            $classConstants = $refClass->getConstants();
            $className = $refClass->getShortName();

            $constantPrefix = 'STATUS_';
            foreach ($classConstants as $key => $val) {
                if (substr($key, 0, strlen($constantPrefix)) === $constantPrefix) {
                    static::$statusValues[$val] = static::getLowerCaseClassName().'.status.'.$val;
                }
            }
        }

        $statusValues = static::$statusValues;

        // Filter on specified status list
        if (isset($filterStatus)) {
            $statusValues = array_filter($statusValues, function ($key) use ($filterStatus) {
                return in_array($key, $filterStatus);
            }, ARRAY_FILTER_USE_KEY);
        }

        if ($withLabelsAsIndexes) {
            return array_flip($statusValues);
        }

        return array_keys($statusValues);
    }
1340566
public static function checkLabel( $label, $name, $id, $checked = false, $attribs = array() ) {
		return self::check( $name, $checked, array( 'id' => $id ) + $attribs ) .
			   '&#160;' .
			   self::label( $label, $id, $attribs );
	}
161275
private static function criteriaWithSoftDelete(array $criteria, bool $withTrash = false)
    {
        $c = [];
        foreach ($criteria as $key => $value) {
            if ($key !== 'deletedAt') {
                $c[$key] = $value;
            }
        }
        if (!$withTrash) {
            $c['deletedAt'] = null;
        }
        return $c;
    }
1284614
private function resolveFilters(
        array $filters,
        $locale,
        $limit = null,
        $page = 1,
        $pageSize = null,
        $options = []
    ) {
        $result = $this->repository->findByFilters($filters, $page, $pageSize, $limit, $locale, $options);

        $hasNextPage = false;
        if (null !== $pageSize && count($result) > $pageSize) {
            $hasNextPage = true;
            $result = array_splice($result, 0, $pageSize);
        }

        return [$result, $hasNextPage];
    }
841243
public function getFilters()
    {
        $roles = user_roles(true);
        unset($roles[DRUPAL_AUTHENTICATED_RID]);

        return [
            (new Filter('status', $this->t("Active")))->setChoicesMap(
                [
                    0 => $this->t("No"),
                    1 => $this->t("Yes"),
                ]
            ),
            (new Filter('role', $this->t("Role")))->setChoicesMap($roles),
            (new Filter('name', $this->t("Name"))),
        ];
    }
232478
static function has($filterName)
    {
        if ($filterName instanceof iFilterStream)
            $filterName = $filterName->getLabel();

        $result = in_array($filterName, self::listFilters());
        return $result;
    }
394109
protected function filterStatuses(SearchNodesRequest $request, Query\BoolQuery $query): void
    {
        if (!$request->has('statuses')) {
            return;
        }

        $statuses = array_map('strval', $request->get('statuses'));
        $query->addFilter(new Query\Terms('status', $statuses));
    }
892271
public FiltersBuilder withLabels(Map<String, String> labels) {
        withFilter("label", labelsMapToList(labels).toArray(new String[labels.size()]));
        return this;
    }
559366
public function QueryLabels(Request\QueryLabels $QueryLabels = null)
    {
        $uri = $this->getUri('/label', array());

        return $this->get($uri, $QueryLabels);
    }
685850
public function addStoreFilter($store, bool $withAdmin = true)
    {
        if (!$this->getFlag('store_filter_added')) {
            if ($store instanceof Store) {
                $store = [$store->getId()];
            }

            if (!is_array($store)) {
                $store = [$store];
            }

            if ($withAdmin) {
                $store[] = Store::DEFAULT_STORE_ID;
            }

            $filterParams = [];

            foreach ($store as $storeId) {
                $filterParams[]['finset'] = $storeId;
            }

            $this->addFilter('store_id', $filterParams, 'public');
        }
        return $this;
    }
476735
public static function getStatusList()
    {
        return [
            self::STATUS_OPEN => 'status_open',
            self::STATUS_PENDING => 'status_pending',
            self::STATUS_VALIDATED => 'status_validated',
            self::STATUS_CANCELLED => 'status_cancelled',
            self::STATUS_ERROR => 'status_error',
            self::STATUS_STOPPED => 'status_stopped',
        ];
    }
1011816
public function getAllLabels()
    {
        $result = $this->get('labels');

        $status = $result->getStatusCode();
        if (204 === $status) {
            return [];
        }
        if (200 === $status) {
            return json_decode($result->getBody()->getContents());
        }

        return false;
    }
683635
public function listIssues(string $filter = AbstractApi::FILTER_ASSIGNED, string $state = AbstractApi::STATE_OPEN,
                               string $labels = '', string $sort = AbstractApi::SORT_CREATED,
                               string $direction = AbstractApi::DIRECTION_DESC, string $since = '1970-01-01'): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/issues?:args', http_build_query([
                'filter'    => $filter,
                'state'     => $state,
                'labels'    => $labels,
                'sort'      => $sort,
                'direction' => $direction,
                'since'     => (new DateTime($since))->format(DateTime::ATOM)
            ])));
    }
1041025
public function withStatus(string $status)
    {
        Assert::oneOf($status, [
            Status::ANY,
            Status::ACTIVE,
            Status::OPEN,
            Status::CLOSED,
            Status::PENDING,
            Status::SPAM,
        ]);

        $filters = clone $this;
        $filters->status = $status;

        return $filters;
    }
31403
func WithStatus(status containerd.ProcessStatus) func(context.Context, *containerd.Client, *containers.Container) error {
	return func(_ context.Context, _ *containerd.Client, c *containers.Container) error {
		ensureLabels(c)
		c.Labels[StatusLabel] = string(status)
		return nil
	}
}
902461
public function getVotesList ($tag = null, bool $with = true) : array
    {
        return $this->_Votes->getVotesList(VoteUtil::tagsConvert($tag), $with);
    }
73907
protected function getStatusChoices(StatusableInterface $statusable)
    {
        $currentStatus = $statusable->getStatus();
        $this->objectManager->persist($currentStatus);

        $choices = array($currentStatus);
        $availableStatus = $this->statusRepository->findAll();

        foreach ($availableStatus as $status) {
            if ($status->getId() != $statusable->getStatus()->getId()
                && $this->authorizationChecker->isGranted($status, $statusable)
            ) {
                $choices[] = $status;
            }
        }

        return $choices;
    }