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

pkg:composer/berduj/propel-enable-disable-behavior

1.0.0 2016-03-03 09:22 UTC

This package is auto-updated.

Last update: 2025-10-11 04:57:43 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.