redrat/entity-datetime
最新稳定版本:0.2.0
Composer 安装命令:
composer require redrat/entity-datetime
包简介
Datetime trait for entities
关键字:
README 文档
README
Trait for easy manage useful datetime in entities.
Install
Install by composer
composer require redrat/entity-datetime
Usage
With Doctrine
1 - Add trait in your Entity
<?php use RedRat\Entity\DateTimeTrait; class Foo { use DateTimeTrait; }
2 - Set lifecycleCallbacks in your Doctrine configuration, like example below:
fields: createdAt: type: datetime updatedAt: type: datetime nullable: true lifecycleCallbacks: prePersist: [ forgeCreatedAt ] preUpdate: [ forgeUpdatedAt ]
Note: More about lifecycle callbacks in Doctrine documentation.
TODO
- API documentation.
统计信息
- 总下载量: 3.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-06-19