havvg / propel-autoexpire-behavior
The AutoExpireBehavior adds automatic expiration to your model.
Installs: 148
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/havvg/propel-autoexpire-behavior
Requires
- propel/propel1: >=1.6.4
This package is not auto-updated.
Last update: 2025-10-25 19:14:45 UTC
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.