berduj/propel-enable-disable-behavior

为 Propel2 启用/禁用行

安装: 40

依赖: 0

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 1

开放问题: 0

类型:propel-behavior

1.0.0 2016-03-03 09:22 UTC

This package is auto-updated.

Last update: 2024-09-11 02:36:37 UTC


README

此行为在表中添加了 "enabled" 列,并添加了启用/禁用每行的方法。

安装

将包添加到您的 composer.json

{
    "require": {
        "berduj/PropelEnableDisableBehavior"
    }
}

使用方法

    <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>

添加的方法

对象方法

$object->enable();
$object->disable();

查询方法

ObjectQuery::create()->findEnabled();
ObjectQuery::create()->findDisabled();

许可证

查看 LICENSE 文件。