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(2y ago)01311MITPHP

Since Jul 16Pushed 2y 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 2d 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

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

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

755d 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.3k18.3M417](/packages/easycorp-easyadmin-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1617.3k16](/packages/2lenet-crudit-bundle)[sylius/sylius

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

8.5k6.0M774](/packages/sylius-sylius)[contao/core-bundle

Contao Open Source CMS

1301.7M3.0k](/packages/contao-core-bundle)[oro/platform

Business Application Platform (BAP)

645146.3k117](/packages/oro-platform)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.9M534](/packages/pimcore-pimcore)

PHPackages © 2026

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