donkeycode / propel-lockable-behavior
Propel behavior that helps you to set a lock per fields
Installs: 14 385
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 0
Open Issues: 0
pkg:composer/donkeycode/propel-lockable-behavior
Requires
- propel/propel1: ~1.6
This package is auto-updated.
Last update: 2025-10-24 06:21:48 UTC
README
The LockableBehavior behavior allows you to mark columns edited and choose forceUpdate or not.
Installation
Cherry-pick the LockableBehavior.php file is src/, put it somewhere,
then add the following line to your propel.ini or build.properties configuration file:
propel.behavior.visibility.class = path.to.LockableBehavior
Usage
Just add the following XML tag in your schema.xml file:
<behavior name="lockable"> <!-- Choose columns to apply --> <parameter name="apply_to" value="my_field, my_other_field" /> </behavior>
The lockable behavior requires four parameters to work:
- apply_to: the list of column to apply the visibility behavior
In php :
- $post->activateLocker()set true to locker fields at- preSave
- $post->activateLockCheck()revert locked fields at- preSaveto only persist not locked fields