PHPackages                             idct/symfony-form-soft-delete-aware-entity-type - 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. idct/symfony-form-soft-delete-aware-entity-type

ActiveLibrary[Database &amp; ORM](/categories/database)

idct/symfony-form-soft-delete-aware-entity-type
===============================================

Repository which adds support for Soft Delete filter behavior to Symfony's EntityType.

1.0.2(1y ago)01311MITPHP

Since Jul 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ideaconnect/symfony-form-soft-delete-aware-entity-type)[ Packagist](https://packagist.org/packages/idct/symfony-form-soft-delete-aware-entity-type)[ RSS](/packages/idct-symfony-form-soft-delete-aware-entity-type/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (8)Versions (4)Used By (1)

Symfony Form SoftDeleteAware EntityType
=======================================

[](#symfony-form-softdeleteaware-entitytype)

[![Tests status](https://github.com/ideaconnect/symfony-form-soft-delete-aware-entity-type/actions/workflows/run-tests.yml/badge.svg "Tests status")](https://github.com/ideaconnect/symfony-form-soft-delete-aware-entity-type/actions/workflows/run-tests.yml/badge.svg)[![Code Coverate](https://camo.githubusercontent.com/8569cf21c80a6eb66b807d4222f8802b89d61d43f076449d15642dc91311e44a/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f69646561636f6e6e6563742f73796d666f6e792d666f726d2d736f66742d64656c6574652d61776172652d656e746974792d747970652f62616467652e7376673f6272616e63683d6d61696e "Code coverage status")](https://camo.githubusercontent.com/8569cf21c80a6eb66b807d4222f8802b89d61d43f076449d15642dc91311e44a/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f69646561636f6e6e6563742f73796d666f6e792d666f726d2d736f66742d64656c6574652d61776172652d656e746974792d747970652f62616467652e7376673f6272616e63683d6d61696e)

The missing link between `softdeleteable` from [doctrine/extensions](https://github.com/doctrine-extensions/DoctrineExtensions) and Symfony Form component.

Warning!
========

[](#warning)

If you need to use this it most likely means that you have a bad architecture of your software. If you allow deletion or soft deletion you should first make sure that each related entity is updated first with `null` or new relation. This form type is meant to be used for transition purposes in systems which need to quickly add soft deletion on some entities which are used in relations, but due to time or other resources it is impossible to upgrade the actual processes.

Purpose
-------

[](#purpose)

If you are using the `softdeleteable` filter and `EntityType` forms you may encounter a situation when your CRUD Edit form in which the related entity is no longer available as soft removed. This form type will make the form still properly render, but forcing the user to update the relation using the form.

In such situation, using standard entity type you may see a screen like this:

[![Entity of type 'App\Entity\DeletableEntity' for IDs id(1) was not found](.github/images/1.png "Error message")](.github/images/1.png)

With the `SoftDeleteAwareEntityType` it will revert to the placeholder forcing user to update:

[![Success with the plugin](.github/images/2.png "Success")](.github/images/2.png)

Compatibility
-------------

[](#compatibility)

- Symfony 6 or 7.
- Sonata Admin 3+

Installation
------------

[](#installation)

First require it in your project:

```
composer require idct/symfony-form-soft-delete-aware-entity-type
```

As this is not a bundle register in your `services` (for example `services.yaml`) file:

If you have autowiring:

```
    IDCT\SymfonyFormSoftDeleteAwareEntityType\SoftDeleteAwareEntityType: ~
```

If you do not use autowiring you need to pass doctrine as the first argument:

```
    IDCT\SymfonyFormSoftDeleteAwareEntityType\SoftDeleteAwareEntityType:
        arguments:
            - '@doctrine'
```

Now in forms which use `EntityType` change the form type to `SoftDeleteAwareEntityType`. For example:

```
class ParentFormType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('test', SoftDeleteAwareEntityType::class, [
                'class' => DummyEntity::class
            ])
        ;
    }
}
```

And that is all!

Testing
=======

[](#testing)

Tool has a testing toolchain prepared using Docker. If you have docker installed simply run `./run-tests.sh`.

This will run unit tests with PHPUnit, generate code-coverage report and run some functional e-2-e tests using Behat and Chrome Driver.

Contribution
============

[](#contribution)

Any contribution is more then welcome, please file any issues or pull requests, yet when possible please try to make sure that tests are working.

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

710d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/168780730?v=4)[IDCT Bartosz Pachołek](/maintainers/ideaconnect)[@ideaconnect](https://github.com/ideaconnect)

---

Top Contributors

[![bpacholek](https://avatars.githubusercontent.com/u/3039162?v=4)](https://github.com/bpacholek "bpacholek (11 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/idct-symfony-form-soft-delete-aware-entity-type/health.svg)

```
[![Health](https://phpackages.com/badges/idct-symfony-form-soft-delete-aware-entity-type/health.svg)](https://phpackages.com/packages/idct-symfony-form-soft-delete-aware-entity-type)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M376](/packages/easycorp-easyadmin-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)[oro/platform

Business Application Platform (BAP)

642140.7k104](/packages/oro-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.1k16.8k](/packages/prestashop-prestashop)[kimai/kimai

Kimai - Time Tracking

4.7k8.7k1](/packages/kimai-kimai)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
