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

ReferenceMany : Store reference and a label #1619

Closed
ghost opened this issue Jul 18, 2017 · 2 comments
Closed

ReferenceMany : Store reference and a label #1619

ghost opened this issue Jul 18, 2017 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented Jul 18, 2017

Hello
I created a ReferenceMany relation in order to add actors to a movie. It works perfectly, but I'm looking for a solution to store the actor name with the reference.
I just need a quick way to get the actors names without calling the Actor Collection
So I'd like to store the name with the reference.

Is it possible, and how ?
Thanks

Grégory

@alcaeus
Copy link
Member

alcaeus commented Jul 18, 2017

Out of the box, no. I've started working on that feature in #1527, but decided to move it to the 2.0 milestone because it may require some reference changes. At this time, I wouldn't hold my breath to get this in a 1.x release.

As for a workaround, you may be able to magically update the owning object by gaining access to the owner in a postLoad event handler (using the getParentAssociation method in UnitOfWork) and updating the owning object. The name won't be stored on the reference but in a separate field since you don't have access to the generated DBRef object.

@ghost
Copy link
Author

ghost commented Jul 18, 2017

Ok, thanks for your quick answer !

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

No branches or pull requests

1 participant