wernerdweight/doctrine-cascade-soft-delete-bundle
最新稳定版本:2.0.0
Composer 安装命令:
composer require wernerdweight/doctrine-cascade-soft-delete-bundle
包简介
A Symfony bundle that enables your application to cascade on delete even if you're using soft-delete.
README 文档
README
A Symfony bundle that enables your application to cascade on delete even if you're using soft-delete.
Installation
1. Download using composer
composer require wernerdweight/doctrine-cascade-soft-delete-bundle
2. Enable the bundle
Enable the bundle in your kernel:
<?php // config/bundles.php return [ // ... WernerDweight\DoctrineCascadeSoftDeleteBundle\DoctrineCascadeSoftDeleteBundle::class => ['all' => true], ];
Configuration
No configuration is required. This bundle automatically extends the default behaviour and soft-deletes any related entities. Use standard Doctrine cascading options (onDelete="CASCADE|DETACH").
Trade-offs
To be able to cascade soft-delete, each entity must have an identifier. M:N relationship thus needs to be refactored to an entity with two 1:N relationships. If an M:N related entity is attempted to be cascaded, an exception is thrown.
Each entity that should be able to be cascaded must also be soft-deletable (i.e. has deletedAt property).
License
This bundle is under the MIT license. See the complete license in the root directiory of the bundle.
统计信息
- 总下载量: 4.9k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-10-21