marcj / propel-eventdispatcher-behavior
将 Symfony2 EventDispatcher 组件集成到 Propel2 alpha 3 的模型类中。
1.0.1
2014-11-22 13:13 UTC
Requires
- symfony/event-dispatcher: ~2.1
This package is auto-updated.
Last update: 2024-09-10 23:55:00 UTC
README
将 Symfony2 EventDispatcher 组件集成到 Propel 2 alpha 3 的模型类中。最终的 Propel 2 版本将会将此集成到核心中。这是为已经使用 Propel 2 并需要这些行为的开发者提供的。
安装
在 composer.json
中需要此行为
{ "require": { "willdurand/propel-eventdispatcher-behavior": "dev-master" } }
将以下行添加到您的 propel.ini
或 build.properties
配置文件中
propel.behavior.eventdispatcher.class = vendor.willdurand.propel-eventdispatcher-behavior.src.EventDispatcherBehavior
注意:
vendor.willdurand.propel-eventdispatcher-behavior.src
是行为的 dot-path 路径。
最后,将此行为添加到您的 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 许可证发布。有关详细信息,请参阅附带许可证文件。