Open alihammad-gist opened 10 years ago
+1
@Danielss89 is this something that should be ZfcUser's concern, or the concern of the class doing the extending?
This can be fixed in ZfcUser by adding this to Zfcuser\Service\User
:
/**
* @var array
*/
protected $eventIdentifier = array(__CLASS__);
However, the extending class could just as easily do this instead:
/**
* @var array
*/
protected $eventIdentifier = array('ZfcUser\Service\User');
I'm in favor of the latter + a blurb of documentation somewhere stating that if you override the service you must add the stock service's fqcn to the event manager's identifier set.
Unless there's a specific case against it, I vote to be proactively extension friendly. A new module is overwhelming enough without having to pick every single gotcha out of the documentation.
Right now zfcuser extend's ZfcBase's EventProvider in ZfcUser\Service\User and the Event Manager is assigned Identifiers dynamically one of which is usually ZfcUser\Service\User untill you override the service locator service zfcuser_service_user with a custom service and you can't assign listeners to ZfcUser\Service\User 's event manager using shared event manager because ZfcUser\Service\User identifier is dynamically changed with custom service's name you wrote. It would be benifitial if ZfcUser\Service\User is exlicitly added to its event manager's identifiers