Get either a count of or list of replies

@param   array   $filters  Filters to apply to query
@return  object
339282
public function replies($filters = array())
	{
		if (!isset($filters['item_id']))
		{
			$filters['item_id'] = $this->get('item_id');
		}

		if (!isset($filters['item_type']))
		{
			$filters['item_type'] = $this->get('item_type');
		}

		$entries = self::all()
			->whereEquals('parent', (int) $this->get('id'))
			->whereEquals('item_type', $filters['item_type'])
			->whereEquals('item_id', (int) $filters['item_id']);

		if (isset($filters['state']))
		{
			$entries->whereIn('state', (array) $filters['state']);
		}

		return $entries;
	}
886543
public static function count($filter = []): int
    {
        /* @var $class LightModel */
        $className = get_called_class();
        $class = new $className;
        $tableKey = $class->getKeyName();

        $sql = 'SELECT COUNT(' . $tableKey . ') FROM ' . $class->getTableName() . ' WHERE 1=1';
        $params = self::handleFilter($sql, $filter, $class);

        $query = DB::getConnection()->prepare($sql);
        $query->execute($params);

        return (int) $query->fetchColumn(0);
    }
692404
public function list(array $filters = [])
    {
        return self::$curl->get(self::$base_url.'?'.http_build_query(['filters' => json_encode($filters)]));
    }
969156
function getComments(array $filter = array())
    {
        $params = array(1, $this->username, $this->password, $filter);

        return $this->sendRequest('wp.getComments', $params);
    }
577630
public function searchSpecifications(array $filters = [], array $options = [])
    {
        $data = [
            'body' => ['query' => $filters]
        ];

        $response = $this->kuzzle->query(
            $this->kuzzle->buildQueryArgs('collection', 'searchSpecifications'),
            $data,
            $options
        );

        return $response['result'];
    }
497941
public function filter(array $filters = array())
    {
        foreach ($filters as $k => $v) {
            if (is_bool($v)) {
                $filters[$k] = $v ? 'true' : 'false';
            }
        }
        return $this->mergeAttributes('filters', $filters);
    }
1223784
public function getAll(array $filters = null)
    {
        $response = $this->mailjet->get(Resources::$Template,
            ['filters' => $filters]);
        if (!$response->success()) {
            $this->throwError("TemplateService :getAll() failed", $response);
        }

        return $response->getData();
    }
1077708
public function where($filters, $values = null)
    {
        if ($filters === null) {
            return $this;
        }

        foreach (is_array($filters) ? $filters : [$filters => $values] as $filter => $value) {
            if (is_int($filter)) {
                $this->whereExpr($value);
            } elseif (is_array($value)) {
                if (preg_match('#([~@!<>|=%]+)$#', $filter, $match)) {
                    $operator = $match[1];
                    $field = substr($filter, 0, -strlen($operator));
                    if ($operator === '~=') {
                        if (count($value) !== 2) {
                            throw new MisuseException(['`value of :filter` filter is invalid', 'filter' => $filter]);
                        }
                        $this->whereBetween($field, $value[0], $value[1]);
                    } elseif ($operator === '@=') {
                        $this->whereDateBetween($field, $value[0], $value[1]);
                    } elseif ($operator === '|=') {
                        $this->_filters[] = [$field => ['$in' => $value]];
                    } elseif ($operator === '!=' || $operator === '<>') {
                        $this->whereNotIn($field, $value);
                    } elseif ($operator === '=') {
                        $this->whereIn($field, $value);
                    } elseif ($operator === '%=') {
                        $this->whereMod($field, $value[0], $value[1]);
                    } else {
                        throw new MisuseException(['unknown `:operator` operator', 'operator' => $operator]);
                    }
                } elseif (!$value || isset($value[0])) {
                    $this->whereIn($filter, $value);
                } else {
                    $this->_filters[] = [$filter => $value];
                }
            } elseif (preg_match('#^([\w\.]+)\s*([<>=!^$*~,@dm?]*)$#', $filter, $matches) === 1) {
                list(, $field, $operator) = $matches;

                if (strpos($operator, '?') !== false) {
                    $value = is_string($value) ? trim($value) : $value;
                    if ($value === '' || $value === null) {
                        continue;
                    }
                    $operator = substr($operator, 0, -1);
                }

                if ($operator === '') {
                    $operator = '=';
                }

                if (in_array($operator, ['=', '~=', '!=', '<>', '>', '>=', '<', '<='], true)) {
                    $this->whereCmp($field, $operator, $value);
                } elseif ($operator === '^=') {
                    $this->whereStartsWith($field, $value);
                } elseif ($operator === '$=') {
                    $this->whereEndsWith($field, $value);
                } elseif ($operator === '*=') {
                    $this->whereContains($field, $value);
                } elseif ($operator === ',=') {
                    $this->whereInset($field, $value);
                } elseif ($operator === '@d=') {
                    $this->whereDate($field, $value);
                } elseif ($operator === '@m=') {
                    $this->whereMonth($field, $value);
                } else {
                    throw new MisuseException(['unknown `:operator` operator', 'operator' => $operator]);
                }
            } elseif (strpos($filter, ',') !== false && preg_match('#^[\w,\.]+$#', $filter)) {
                $this->where1v1($filter, $value);
            } else {
                throw new InvalidValueException(['unknown mongodb query `filter` filter', 'filter' => $filter]);
            }
        }

        return $this;
    }
71170
protected function getResultFromEngine($filters, $sorting, $queryKeys)
    {
        return $this->engine->search($this->buildConditions($filters), $sorting, $queryKeys);
    }
458676
public function addFilters(array $filters)
    {
        foreach ($filters as $filter) {
            if ($filter instanceof QueryDSL) {
                $this->addFilter($filter);
            }
        }
        return $this;
    }
70788
public function listing($filters)
	{
		$listing = $this->smalldb->createListing($filters);
		return [
			'items' => array_values($listing->fetchAll()),	// Order of object's properties not guaranteed in JS
			'processed_filters' => $listing->getProcessedFilters(),
		];
	}
119161
public function get($filter, $cols = null) {
		$query = $this->newSelect();
		if (is_array($cols)) {
			$query->addColumns(...$cols);
		}
		if (!is_array($filter)) {
			$query->where(field($this->_primary_key)->eq($filter));
		} else {
			foreach ($filter as $k => $v) {
				$query->andWhere(field($k)->eq($v));
			}
		}
		$query->limit(1);
		$result = $this->execute($query);
		return count($result) > 0 ? current($result) : null;
	}
510435
public function count($tableSpec, array $filters = [])
    {
        $filters['_id.type'] = $tableSpec;
        return $this->getCollectionForTableSpec($tableSpec)->count($filters);
    }
764065
public function count(array $locales = null,  array $filters = null)
    {
        $query = TransUnitQuery::create()
            ->select('Id')
            ->distinct()
        ;

        $this->addTransUnitFilters($query, $filters);
        $this->addTranslationFilter($query, $locales, $filters);

        return $query->count($this->getConnection());
    }
1256419
public function list(array $filters = [])
    {
        $data = [
            'filters' => json_encode($filters),
        ];

        $url = $this->url.'?'.http_build_query($data);

        return $this->curl->get($url);
    }
1057618
public function getAll(array $filters = [])
    {
        $vars = $this->getEnvironmentVariables();

        foreach ($filters as $filter) {
            if (!$filter instanceof FilterInterface) {
                throw new FilterException(sprintf(
                    '%s %s %s',
                    'The $filters param must be an array',
                    'and your values must be an instance of',
                    '\Cekurte\Environment\Contract\FilterInterface'
                ));
            }

            $vars = $filter->filter($vars);
        }

        $callback = function ($rawValue) {
            return $this->getValue($rawValue);
        };

        return array_map($callback, $vars);
    }
345056
public function setFilters(array $filters)
    {
        if (empty($filters)) {
            return $this->clearFilters();
        }

        session()->put($this->getSessionKey(static::TYPE_FILTERS), $filters);

        return $this;
    }