Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

BinaryKitten
Copy link

No description provided.

@mtudor
Copy link

mtudor commented Oct 22, 2013

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!

@mtudor
Copy link

mtudor commented Oct 22, 2013

I also extracted the entity class out into a separate factory to ease overriding in #189.

@ClemensSahs
Copy link
Contributor

👍

@Danielss89
Copy link
Member

This will be fix with rewrite of forms #425

@Danielss89 Danielss89 closed this Apr 18, 2014
@webdevilopers
Copy link

I'm really looking forward to the zfcuser_user_hydrator config option.
It will probably fix some (of my) issues on the ZfcUserAdmin module:

Can you tell when the new version will be available?

@webdevilopers
Copy link

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 DoctrineHydrator to extend the ZfcUser Form especially with you ZfcUserAdmin module.

@ojhaujjwal
Copy link
Contributor

This issue is already fixed in master branch. Check UserMapperFactory.php#L30 and UserHydratorFactory.php#L19

@webdevilopers
Copy link

Thanks for the hint, @ojhaujjwal !
I can't find an example in the docs / README.md how to make use of it.

I tried this in my Module.php inside the onBootstrap method:

$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 ?

@ClemensSahs
Copy link
Contributor

@webdevilopers
many way's to rome ;)

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 ;)

@webdevilopers
Copy link

Works like a charm, thanks @ClemensSahs !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants