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

Is it possible insert header detail(one to many) data at once #1720

Closed
et4m1r opened this issue Jul 24, 2017 · 2 comments
Closed

Is it possible insert header detail(one to many) data at once #1720

et4m1r opened this issue Jul 24, 2017 · 2 comments

Comments

@et4m1r
Copy link

et4m1r commented Jul 24, 2017

FEATURE REQUEST
entity #1 - Post
entity #2 - Image (many to one with post)

i want to insert 1 post and multi image at once

@forsetius
Copy link
Contributor

You can do it with prePersistPostEntity() method in your controller. You need to define it and iterate over image collection creating Image entities and persisting them to database.

Also, if you need to edit the Post and manipulate its images collection you need to consider defining preUpdatePostEntity() method that would check for missing images and create them like in "persist" event.

@javiereguiluz
Copy link
Collaborator

Closing as fixed by @forsetius comments. Thanks!

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

No branches or pull requests

3 participants