Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[FormBundle] Order the FormSubmissionFields like their respective PageParts on the FormPage #446

Merged
merged 2 commits into from Jun 2, 2015

Conversation

ghost
Copy link

@ghost ghost commented May 27, 2015

Q A
Bug fix? no
New feature? yes
BC breaks? yes
Deprecations? no
Fixed tickets 445

$em = $this->getDoctrine()->getManager();
$nodeTranslation = $em->getRepository('KunstmaanNodeBundle:NodeTranslation')->find($nodeTranslationId);
$formSubmission = $em->getRepository('KunstmaanFormBundle:FormSubmission')->find($submissionId);
$formSubmissionFields = $em->getRepository('KunstmaanFormBundle:FormSubmissionField')->getFieldsOrderedBySequence($formSubmission);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would you fetch them separately? The fields are a property of FormSubmission, and can be sorted there according to their sequence by adding a simple Doctrine annotation. cfr. http://doctrine-orm.readthedocs.org/en/latest/tutorials/ordered-associations.html

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! That's indeed what I needed but didn't find right away. Will fix tomorrow. Thx!
I clearly need to fix the tests as well, oops.

@roderik
Copy link
Contributor

roderik commented May 28, 2015

@kln3wrld please squash

@roderik roderik added this to the 3.1.2 milestone May 28, 2015
@roderik roderik changed the title [FormBundle] order the FormSubmissionFields like their respective PageParts on the FormPage [FormBundle] Order the FormSubmissionFields like their respective PageParts on the FormPage May 28, 2015
@roderik roderik modified the milestones: 3.2.0, 3.1.2 May 30, 2015
@roderik
Copy link
Contributor

roderik commented Jun 2, 2015

@kln3wrld put the upgrade info in upgrade-3.2, not in upgrade. Then I can merge it

roderik pushed a commit that referenced this pull request Jun 2, 2015
[FormBundle] Order the FormSubmissionFields like their respective PageParts on the FormPage
@roderik roderik merged commit 0f7a8a2 into Kunstmaan:master Jun 2, 2015
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants