定制 havvg/propel-autoexpire-behavior 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

havvg/propel-autoexpire-behavior

最新稳定版本:0.1.0

Composer 安装命令:

composer require havvg/propel-autoexpire-behavior

包简介

The AutoExpireBehavior adds automatic expiration to your model.

README 文档

README

Build Status

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.

  1. The preExpire method is called. The process will be aborted, if this methods returns false.
  2. The doExpire method will be called.
  3. The postExpire method 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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-12-09