-
-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'entity_listener_resolver' config key #199
Add 'entity_listener_resolver' config key #199
Conversation
)); | ||
} | ||
|
||
$config->setEntityListenerResolver($serviceLocator->get($entityListenerResolver)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is only available in master right now. You should probably throw an exception if method_exists
returns false, or this PR has to wait lock onto 2.4 (which may be possible in 3~4 weeks)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can wait for 2.4 (:
Needs docs :) |
Travis fail fixed by zendframework/zendframework#4216 |
@danizord can you rebase this one? |
@Ocramius done. |
@danizord ok, a couple more things:
|
@@ -75,6 +75,21 @@ public function createService(ServiceLocatorInterface $serviceLocator) | |||
} | |||
} | |||
|
|||
if ($entityListenerResolver = $options->getEntityListenerResolver()) { | |||
if (is_string($entityListenerResolver)) { | |||
if (!$serviceLocator->has($entityListenerResolver)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably just directly call get
and let the exception bubble up
Any news about this? :) |
I'll finish it next weekend. |
News? :D |
@danizord PR looks nice, I could use this as well. Are you able to finish this? |
Sorry for delay guys (I completely forgot this PR), I'm finishing now. |
@danizord Thanks for your efforts. We are all busy men, and forget to finish tasks from time to time ;-) |
Ping @Ocramius - done ;) |
) { | ||
$this->entityListenerResolver = $entityListenerResolver; | ||
|
||
return $this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entire class has fluent interface, It should not be homogeneous?
To ensure that the is_string call is executed last
…resolver Add 'entity_listener_resolver' config key
This introduces the possibility to use a custom implementation of
Doctrine\ORM\Mapping\EntityListenerResolver
by setting
entity_listener_resolver
config key.