berduj / propel-enable-disable-behavior
Enable / Disabe rows for Propel2
Installs: 40
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Type:propel-behavior
Requires
- php: >=5.4
- propel/propel: ~2.0@dev
This package is auto-updated.
Last update: 2024-11-11 03:03:12 UTC
README
The Behavior adds "enabled" column in table, and adds methods to enable/disable each rows.
Installation
Add the package to your composer.json
:
{ "require": { "berduj/PropelEnableDisableBehavior" } }
Usage
<table name="sample_table"> <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" /> <column name="title" type="VARCHAR" /> <behavior name="enable-disable"/> </table>
Added methods :
Object methods:
$object->enable();
$object->disable();
Query methods:
ObjectQuery::create()->findEnabled();
ObjectQuery::create()->findDisabled();
License
See the LICENSE file.