# ProfileSearch

> Filters captured profile rows for the unified Profiling timeline and table.

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

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

Filters captured profile rows for the unified Profiling timeline and table.

## 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. | `ProfileSearch` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`category()`](#method-category) | Returns the submitted `category` filter value. | `ProfileSearch` |
| [`duration()`](#method-duration) | Returns the submitted `duration` filter value. | `ProfileSearch` |
| [`filter()`](#method-filter) | Keeps only the spans matching every active filter. | `ProfileSearch` |
| [`fromQueryParams()`](#method-fromQueryParams) static | Builds the search model from the submitted filter values. | `ProfileSearch` |
| [`info()`](#method-info) | Returns the submitted `info` filter value. | `ProfileSearch` |

## Method details

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

```php
public function category(): string
```

Returns the submitted `category` filter value.

**Returns**

`string`: Submitted `category` filter value, or `''` when the filter is not active.

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

```php
public function duration(): string
```

Returns the submitted `duration` filter value.

**Returns**

`string`: Submitted `duration` filter value, or `''` when the filter is not active.

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

```php
public function filter(list<PHPForge\Debug\Panel\Profile\ProfileRow> $rows): list<PHPForge\Debug\Panel\Profile\ProfileRow>
```

Keeps only the spans matching every active filter.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$rows` | `list<PHPForge\Debug\Panel\Profile\ProfileRow>` | Captured spans to filter. |

**Returns**

`list<PHPForge\Debug\Panel\Profile\ProfileRow>`: 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 span filters.

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

```php
public function info(): string
```

Returns the submitted `info` filter value.

**Returns**

`string`: Submitted `info` filter value, or `''` when the filter is not active.