# HistorySearch

> Filters captured request rows from the Debug[...] query group.

[API reference](/docs/api/index.md) › [Yii3 Debug](/docs/extensions/yii3-debug/reference/index.md) › [Search](/docs/extensions/yii3-debug/reference/search/index.md) › HistorySearch

| final readonly class | `Yii3\Debug\Search\HistorySearch` |
| --- | --- |
| Source | [`src/Search/HistorySearch.php`](https://github.com/yii3/debug/blob/main/src/Search/HistorySearch.php#L15) |

Filters captured request rows from the `Debug[...]` query group.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-activeFilters"></span>`$activeFilters` readonly constructor | `array<string, string>` | Submitted filter values kept for this group, keyed by attribute. | `HistorySearch` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`filter()`](#method-filter) | Keeps only the captures matching every active filter. | `HistorySearch` |
| [`fromQueryParams()`](#method-fromQueryParams) static | Builds the search model from the submitted filter values. | `HistorySearch` |

## Method details

### filter() <span id="method-filter"></span>

```php
public function filter(list<PHPForge\Debug\View\History\HistoryRow> $rows): list<PHPForge\Debug\View\History\HistoryRow>
```

Keeps only the captures matching every active filter.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$rows` | `list<`[`HistoryRow`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/View/History/HistoryRow.php)`>` | Captured requests to filter. |

**Returns**

`list<`[`HistoryRow`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/View/History/HistoryRow.php)`>`: Rows matching every active filter, reindexed.

### fromQueryParams() <span id="method-fromQueryParams"></span>

```php
public static function fromQueryParams(array<array-key, mixed> $queryParams): self
```

Builds the search model from the submitted filter values.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$queryParams` | `array<array-key, mixed>` | Raw query parameters of the debugger request. |

**Returns**

`self`: Search model holding the active capture filters.