# Soft Delete API reference

> API reference of the Soft Delete extension (yii2\extensions\softdelete), generated from its PHPDoc.

[API reference](/docs/api/index.md) › Soft Delete

Classes, interfaces, traits and enums of `yii2\extensions\softdelete`, generated from the PHPDoc of [yii2-extensions/soft-delete](https://github.com/yii2-extensions/soft-delete) at `main`. Machine-readable catalog: [soft-delete.json](https://yii2-framework.github.io/docs/reference/soft-delete.json).

## Namespaces

| Namespace | Types |
| --- | --- |
| [`yii2\extensions\softdelete\exception`](/docs/extensions/soft-delete/reference/exception/index.md) | 1 |

## Classes

| Class | Summary |
| --- | --- |
| [`Condition`](/docs/extensions/soft-delete/reference/condition/index.md) final | Marks a query condition as owned by the soft-delete scope and qualifies its bare column names with a table alias. |
| [`DeleteBehavior`](/docs/extensions/soft-delete/reference/deletebehavior/index.md) | Marks ActiveRecord models as deleted instead of removing their rows, and restores them from that state. |
| [`QueryBehavior`](/docs/extensions/soft-delete/reference/querybehavior/index.md) | Scopes SQL [`ActiveQuery`](/docs/api/yii/db/activequery/index.md) results to records that are, or are not, marked as deleted by [`DeleteBehavior`](/docs/extensions/soft-delete/reference/deletebehavior/index.md). |
| [`ScopedQuery`](/docs/extensions/soft-delete/reference/scopedquery/index.md) | SQL ActiveQuery that retains its soft-delete scope when [`alias()`](/docs/extensions/soft-delete/reference/scopedquery/index.md#method-alias) changes the primary table alias. |