andrew-kandels/contain — pull request #17 by mwillbanks (2013-07-10 13:41:05+00:00)
Title: Compiler should be eventful!

* Implemented Zend\\EventManager\\EventManager
* Updated scripts to utilize ServiceManager

A quick example of how you might write an initializer:
```php
class Module
{
public function getServiceConfig()
{
return array(
'initializers' => array(
'ContainEntityCompiler' => function ($service, $sm) {
if ($service instanceof \Contain\Entity\Compiler\Compiler) {
$service->getEventManager()->attach('definition.set', function ($e) {
$definition = $e->getParam('definition');
if ($definition instanceof Entity\Definition\MyDefinition) {
$definition->setProperty(
'extended',
'boolean'
);
}
});
}
}
),
);
}
}
```