You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I access a variable and its null, what is wrong?
If this variable is a public variable then you are violating one of the criteria for entities. All properties have to be protected or private for the proxy object pattern to work.
Is this true? All my entities have public fields, and no getters or setters, but doctrine does work fine. Also it is the first time I read that having private/protected fields with getter and setter is a must. Up to now I thought it is more or less a coding standard (and waste of space ;-))
The text was updated successfully, but these errors were encountered:
I randomly found this remark in the FAQs:
https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/faq.html#i-access-a-variable-and-its-null-what-is-wrong
Is this true? All my entities have public fields, and no getters or setters, but doctrine does work fine. Also it is the first time I read that having private/protected fields with getter and setter is a must. Up to now I thought it is more or less a coding standard (and waste of space ;-))
The text was updated successfully, but these errors were encountered: