gharlan/propel-event-dispatcher-behavior

将 Symfony EventDispatcher 组件集成到 Propel 的模型类中。

安装量: 101,965

依赖者: 1

建议者: 0

安全: 0

星标: 1

关注者: 2

分叉: 15

开放问题: 1

类型:propel-behavior

3.2 2022-06-30 19:35 UTC

This package is auto-updated.

Last update: 2024-08-29 03:47:27 UTC


README

Build Status

将 Symfony2 EventDispatcher 组件集成到 Propel 2 alpha 3 的模型类中。最终 Propel 2 的正式发布版本将集成到核心中。这仅适用于已经使用 Propel 2 到 alpha 3 并需要这些行为的用户。

安装

在您的 composer.json 中需要此行为

{
    "require": {
        "willdurand/propel-eventdispatcher-behavior": "dev-master"
    }
}

将以下行添加到您的 propel.inibuild.properties 配置文件中

propel.behavior.eventdispatcher.class = vendor.willdurand.propel-eventdispatcher-behavior.src.EventDispatcherBehavior

注意:vendor.willdurand.propel-eventdispatcher-behavior.src 是行为在点路径表示法中的路径。

最后,将此行为添加到您的 schema.xml

<database name="foo">
    <table name="a-table">
        <behavior name="event_dispatcher" />
    </table>
</database>

ActiveRecord API

此行为添加了一个单一的方法 getEventDispatcher()。此方法为每个类创建一个 EventDispatcher 实例。

运行测试

安装依赖项

php composer.phar install --dev

运行测试套件

phpunit

许可证

此行为在 MIT 许可证下发布。有关详细信息,请参阅捆绑的 LICENSE 文件。