havvg/propel-autoexpire-behavior
最新稳定版本:0.1.0
Composer 安装命令:
composer require havvg/propel-autoexpire-behavior
包简介
The AutoExpireBehavior adds automatic expiration to your model.
README 文档
README
See the Propel documentation on how to install a third party behavior
Usage
Just add the following XML tag in your schema.xml file:
<behavior name="auto_expire" />
The behavior will add a column storing the expiration date and those methods: preExpire, expire, doExpire, postExpire and isExpired.
Configuration
The following options are provided to customize the behavior.
The column option defines the name of the column to store the expiration date into.
If the column is not given, it will be added. Defaults to expires_at.
The required flag indicates whether the expiration date is required.
If true the column will be NOT NULL.
An auto_delete option can be set to automatically delete the expired model.
When set, this option will apply the "Expiration" behavior to the postHydrate hook of the model.
Expiration
Whenever a model expires by calling expire, the following behavior is applied - similar to save or delete.
- The
preExpiremethod is called. The process will be aborted, if this methods returnsfalse. - The
doExpiremethod will be called. - The
postExpiremethod is called afterwards.
In addition, the isExpired method will be added to check whether the model is expired.
统计信息
- 总下载量: 148
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-12-09