PHPackages                             evence/soft-deleteable-extension-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. evence/soft-deleteable-extension-bundle

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

evence/soft-deleteable-extension-bundle
=======================================

Fixed to work with Symfony 5.0+. Adjusted from E-vence/SoftDeleteableListenerExtensionBundle.

3.2.4(1y ago)58568.5k—2.2%38[6 issues](https://github.com/E-vence/SoftDeleteableListenerExtensionBundle/issues)1PHPPHP &gt;=8.0

Since Mar 15Pushed 1y ago4 watchersCompare

[ Source](https://github.com/E-vence/SoftDeleteableListenerExtensionBundle)[ Packagist](https://packagist.org/packages/evence/soft-deleteable-extension-bundle)[ RSS](/packages/evence-soft-deleteable-extension-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (23)Used By (1)

SoftDeleteableListenerExtensionBundle
=====================================

[](#softdeleteablelistenerextensionbundle)

Extensions to Gedmo's softDeleteable listener which has had this issue reported since 2012 : [doctrine-extensions/DoctrineExtensions#505](https://github.com/doctrine-extensions/DoctrineExtensions/issues/505).

Provides the `onSoftDelete` functionality to an association of a doctrine entity. This functionality behaves like the SQL `onDelete` function (when the owner side is deleted). *It will prevent Doctrine errors when a reference is soft-deleted.*

**Cascade delete the entity**

To (soft-)delete an entity when its parent record is soft-deleted :

```
 @Evence\onSoftDelete(type="CASCADE")

```

**Set reference to null (instead of deleting the entity)**

```
 @Evence\onSoftDelete(type="SET NULL")

```

**Replace reference by some property marked as successor (must be of same entity class)**

```
 @Evence\onSoftDelete(type="SUCCESSOR")

```

Entity example
--------------

[](#entity-example)

```
