willdurand / propel-eventdispatcher-behavior
此包已被废弃且不再维护。未建议替代包。
将 Symfony2 EventDispatcher 组件集成到您的模型类中。
1.3.0
2014-02-25 08:50 UTC
Requires
- propel/propel1: ~1.6
- symfony/event-dispatcher: ~2.1
README
将 Symfony2 EventDispatcher 组件集成到您的模型类中。
安装
在您的 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
是行为的点路径表示法中的路径。
最后,将此行为添加到您的 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 文件。