-
Notifications
You must be signed in to change notification settings - Fork 343
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
make use of the zfcuser_user_hydrator system definition #360
Conversation
This PR crosses over with one I created some time ago, that never got merged. See what you think if you have a moment... #189 That one went a little further and extracted the choice of user hydrator and mapper in config, similar to the way in which the user entity can be specified. It also made overriding the service simpler in the same way as your current PR. I can't quite decide whether having these kind of configuration options is desirable or not! |
I also extracted the entity class out into a separate factory to ease overriding in #189. |
👍 |
This will be fix with rewrite of forms #425 |
I'm really looking forward to the zfcuser_user_hydrator config option.
Can you tell when the new version will be available? |
I've recognized the current PR #445 for this fix / feature, @Danielss89 . When will it be available, any idea? I really need to working with |
This issue is already fixed in master branch. Check UserMapperFactory.php#L30 and UserHydratorFactory.php#L19 |
Thanks for the hint, @ojhaujjwal ! I tried this in my $serviceManager = $t->getServiceManager();
$objectManager = $serviceManager->get('doctrine.entitymanager.orm_default');
$serviceManager->setAllowOverride(true);
$serviceManager->setFactory('zfcuser_user_hydrator', function($serviceManager) use ($objectManager){
$hydrator = new DoctrineHydrator($objectManager, 'Application\Entity\User');
return $hydrator;
}); Is this correct @ClemensSahs , @mtudor , @Danielss89, @BinaryKitten ? |
@webdevilopers here is a much better way Module.php#L69-L70 Add a module that overwrite the factory like that and you can hold every flexibility. PS: and you don't need the bootstrap event ;) |
Works like a charm, thanks @ClemensSahs ! |
No description provided.