smagEntityLockingPlugin
The goal of the Plugin is to provide locking mechanisms for single Objects. E.q. you have a number of editors for Article and only one at a time should edit this article then this Plugin will help you to achive this.
Configuration
enable Plugin in app.yml
app/frontend/config/app.yml
all:
locking:
routes_register: true
enabled: true
both are enabled by default bit you can disable for testing for example
enable filter configuration
app/frontend/config/filter.yml
entity_locking:
class: SmagEntityLockingFilter
enabled: <?php echo sfConfig::get('app_locking_enabled') && in_array('locking',sfConfig::get('sf_enabled_modules')) ? "true\n" : "false\n" ?>
this enables the filter which checks for a living lock.
configure what to lock
# locking configuration example
locking:
# needed for resetting all locks by this user
logout_route: logout
# the time a lock lasts in seconds
lock_time: 1800
#locked routes
routes:
article_edit: ~
Now if someone calls /article/1/edit and someone allready is on this page the user is informed about the existing lock, but can still edit other articles.
To disable locking after the timeout include on the edit pages the component
<?php include_component('locking','timer',array())?>