incompass / 软删除包
为 Doctrine 实体添加简单的软删除功能
v3.0.0
2023-01-20 19:46 UTC
Requires
- php: >=8.0
Requires (Dev)
- doctrine/doctrine-bundle: ^1.6
- doctrine/orm: ^2.5
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^9.0
- symfony/framework-bundle: ^2.7|^3.4.0|^4.0
This package is auto-updated.
Last update: 2023-09-20 21:18:02 UTC
README
SoftDeletableBundle
此包允许您简单地通过在 doctrine 实体类中实现 implements SoftDeleteInterface
和 use SoftDeleteTrait
来启用软删除。
安装
Composer
composer require incompass/soft-deletable-bundle
使用方法
实现 SoftDeleteInterface。
class Entity implements SoftDeleteInterface {}
将 SoftDeleteTrait 特性添加到您的 doctrine 实体中。
use SoftDeleteTrait
更新您的数据库模式
php bin/console doctrine:schema:update --force
实体在软删除时将存储 deleted_at 日期时间。
贡献者
Joe Mizzi (casechek/incompass) Mike Bates (casechek/incompass)