PHPackages                             andanteproject/soft-deletable-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. andanteproject/soft-deletable-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

andanteproject/soft-deletable-bundle
====================================

A Symfony Bundle to handle soft deletable with Doctrine Entities

1.2.0(4y ago)1028.3k↓34.1%2MITPHPPHP ^7.4 || ^8.0

Since Feb 24Pushed 2y ago2 watchersCompare

[ Source](https://github.com/andanteproject/soft-deletable-bundle)[ Packagist](https://packagist.org/packages/andanteproject/soft-deletable-bundle)[ RSS](/packages/andanteproject-soft-deletable-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (14)Versions (9)Used By (0)

[![Andante Project Logo](https://github.com/andanteproject/soft-deletable-bundle/raw/main/andanteproject-logo.png?raw=true)](https://github.com/andanteproject/soft-deletable-bundle/blob/main/andanteproject-logo.png?raw=true)

Soft Deletable Bundle
=====================

[](#soft-deletable-bundle)

#### Symfony Bundle - [AndanteProject](https://github.com/andanteproject)

[](#symfony-bundle---andanteproject)

[![Latest Version](https://camo.githubusercontent.com/ab89ed560b07c51eaef7483cc7978a898c2fec14e69ec0df0789354283aed035/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f616e64616e746570726f6a6563742f736f66742d64656c657461626c652d62756e646c652e737667)](https://github.com/andanteproject/soft-deletable-bundle/releases)[![Github actions](https://github.com/andanteproject/soft-deletable-bundle/actions/workflows/workflow.yml/badge.svg?branch=main)](https://github.com/andanteproject/soft-deletable-bundle/actions/workflows/workflow.yml/badge.svg?branch=main)[![Framework](https://camo.githubusercontent.com/99dc13442fc54713a4d33b8f42f3194fbf93165c573a42d804e09c954e9f3970/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d342e78253743352e782d696e666f726d6174696f6e616c3f5374796c653d666c6174266c6f676f3d73796d666f6e79)](https://camo.githubusercontent.com/99dc13442fc54713a4d33b8f42f3194fbf93165c573a42d804e09c954e9f3970/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d342e78253743352e782d696e666f726d6174696f6e616c3f5374796c653d666c6174266c6f676f3d73796d666f6e79)[![Php7](https://camo.githubusercontent.com/c582fc136b4ed23cead60c28938899492ec83e353258d8c01c690196d4e62c8c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253230372e34253743382e782d696e666f726d6174696f6e616c3f7374796c653d666c6174266c6f676f3d706870)](https://camo.githubusercontent.com/c582fc136b4ed23cead60c28938899492ec83e353258d8c01c690196d4e62c8c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253230372e34253743382e782d696e666f726d6174696f6e616c3f7374796c653d666c6174266c6f676f3d706870)[![PhpStan](https://camo.githubusercontent.com/ecf361cdd6dfc8d69061b1cd65e7414a6e6293da2837adfd795aded2e52cc31a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c253230382d737963636573733f7374796c653d666c6174266c6f676f3d706870)](https://camo.githubusercontent.com/ecf361cdd6dfc8d69061b1cd65e7414a6e6293da2837adfd795aded2e52cc31a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c253230382d737963636573733f7374796c653d666c6174266c6f676f3d706870)

Simple Symfony Bundle to handle [soft delete](https://en.wiktionary.org/wiki/soft_deletion) for doctrine entities. So your entities "*are not going to be deleted for real from the database*". 🙌

Requirements
------------

[](#requirements)

Symfony 4.x-5.x and PHP 7.4.

Install
-------

[](#install)

Via [Composer](https://getcomposer.org/):

```
$ composer require andanteproject/soft-deletable-bundle
```

Features
--------

[](#features)

- No configuration required to be ready to go but fully customizabile;
- `deleteAt` property is as a `?\DateTimeImmutable`;
- You can disable the filter runtime even for just some entities;
- No annotation required;
- Works like magic ✨.

Basic usage
-----------

[](#basic-usage)

After [install](#install), make sure you have the bundle registered in your symfony bundles list (`config/bundles.php`):

```
return [
    /// bundles...
    Andante\SoftDeletableBundle\AndanteSoftDeletableBundle::class => ['all' => true],
    /// bundles...
];
```

This should have been done automagically if you are using [Symfony Flex](https://flex.symfony.com). Otherwise, just register it by yourself.

Let's suppose we have a `App\Entity\Article` doctrine entity we want to enable to soft-deletion. All you have to do is to implement `Andante\SoftDeletableBundle\SoftDeletable\SoftDeletableInterface` and use `Andante\SoftDeletableBundle\SoftDeletable\SoftDeletableTrait` trait.

```
