incompass/timestampable-bundle

为symfony和doctrine提供简单高效的时戳

安装: 40,756

依赖者: 1

建议者: 0

安全: 0

星标: 0

关注者: 10

分支: 1

类型:symfony-bundle

v3.0.0 2023-01-20 19:42 UTC

README

Build Status Total Downloads Latest Stable Version

TimestampableBundle

此包允许您简单地通过将 use TimestampInterfaceuse TimestampTrait 添加到 doctrine 实体类中,使其自动添加 created_at 和 updated_at 字段,并在插入和更新时自动更新这些字段。

安装

Composer

composer require incompass/timestampable-bundle

使用方法

将 TimestampInterface 添加到您的 doctrine 实体中。

class {Entity} implements TimestampInterface

将 TimestampTrait 特性添加到您的 doctrine 实体中。

use TimestampTrait

更新您的数据库模式

php bin/console doctrine:schema:update --force

现在所有实体都将保存 created_at 和 updated_at 字段。

贡献者

Joe Mizzi (casechek/incompass)