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

Querying a relationship should be done through the entity not the id #259

Closed
wants to merge 1 commit into from

Conversation

mamazu
Copy link

@mamazu mamazu commented Jun 18, 2024

Why?

  1. If you try to use this with a newly created entity the Id of the entity is null. Null however is not allowed in the interface of the DimensionContentInterface (which I think is correct). Then the only way to do it correctly is leave it uninitialized and then the program crashes. However if we just hand off the handling to doctrine, it's going to use it's magic to get the value of the property directly
  2. If you use the object it's going to use the primary identifier specified in the metadata of that entity. If you had a different primary key than id (I know not a common use case) but this should work now too.

@mamazu mamazu closed this Jul 23, 2024
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.

None yet

1 participant