"Is the foreign key property (e.g., $userId) required in the entity class on the many side when using manual array schema configuration in Cycle ORM?" #545
Answered
by
adaitran771
adaitran771
asked this question in
Q&A
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
adaitran771
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
I have a one-to-many relation (parent has many children).
I'm using manual array schema configuration (no annotations).
When I fetch the parent entity with eager loading (
->load('children')),I get the error: "Cannot access non-public property ... in child class".
I was able to fix it by adding a
parent_idproperty (the foreign key) to the child entity class, and now it works.However, I don't want to have this
parent_idproperty in my child entity class (to keep the domain model clean).Is it possible to configure the relation in manual schema without having the foreign key property in the child class?
I checked the documentation, but there isn't much information about manual schema configuration and this specific issue.
Beta Was this translation helpful? Give feedback.
All reactions