Binding User to Edit Form fixes issues #30 and #31#50
Open
webdevilopers wants to merge 3 commits intoDanielss89:masterfrom
Open
Binding User to Edit Form fixes issues #30 and #31#50webdevilopers wants to merge 3 commits intoDanielss89:masterfrom
webdevilopers wants to merge 3 commits intoDanielss89:masterfrom
Conversation
Setter logic is replaced by binding `User` to `Form` inside controller `edit` action.
Replaces setter logic in `User` `Service`.
Author
|
I just recognized that this required the class Module // forminterface is automatically implemented?
{
public function onBootstrap(MvcEvent $e)
{
$em = $eventManager->getSharedManager();
$em->attach(
'ZfcUserAdmin\Form\EditUser',
'init',
function($e)
{
/* @var $form \ZfcUser\Form\Register */
$form = $e->getTarget();
$sm = $form->getServiceManager();
$om = $sm->get('Doctrine\ORM\EntityManager');
$form->setHydrator($sm->get('zfcuser_user_hydrator'));
}
);
}
}I think this can be achieved by setting the hydrator inside the controller the way it currently happens: |
Author
|
I have added the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These changes are just a proposal for solution for the following issues:
I have not edited further code since I can't tell yet what consequences this will have on
EditUserFormsetUserevent see https://github.com/Danielss89/ZfcUserAdmin/blob/master/src/ZfcUserAdmin/Form/EditUser.php#L72-76EditUserFormpopulateFromUser()method see https://github.com/Danielss89/ZfcUserAdmin/blob/master/src/ZfcUserAdmin/Form/EditUser.php#L83-99and others.
But - similar to binding the
Userto theCreateUserForm inside thecreateActionmethod,this scenario works with Doctrine's ORM with
OneToOneandManyToManyrelationships.Any thoughts, @Danielss89 ?