marcj / propel-eventdispatcher-behavior
Integrates the Symfony2 EventDispatcher component in your Model classes for Propel2 alpha 3.
Installs: 97 888
Dependents: 2
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 15
Type:propel-behavior
Requires
- symfony/event-dispatcher: ~2.1
This package is auto-updated.
Last update: 2024-11-11 00:11:17 UTC
README
Integrate the Symfony2 EventDispatcher component in your Model classes for Propel 2 alpha 3. Final Propel 2 release will have this integrated into core. This is only for guys using Propel 2 already till alpha 3 and need those behavior.
Installation
Requires this behavior in your composer.json
:
{ "require": { "willdurand/propel-eventdispatcher-behavior": "dev-master" } }
Add the following line to your propel.ini
or build.properties
configuration
file:
propel.behavior.eventdispatcher.class = vendor.willdurand.propel-eventdispatcher-behavior.src.EventDispatcherBehavior
Note:
vendor.willdurand.propel-eventdispatcher-behavior.src
is the path of the behavior in dot-path notation.
Finally, adds this behavior to your schema.xml
:
<database name="foo"> <table name="a-table"> <behavior name="event_dispatcher" /> </table> </database>
ActiveRecord API
This behavior adds a single method getEventDispatcher()
.
This method creates an instance of
EventDispatcher
per class.
Running tests
Install dependencies:
php composer.phar install --dev
Run the test suite:
phpunit
License
This behavior is released under the MIT License. See the bundled LICENSE file for details.