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

Documentation wrong? #7427

Closed
flaushi opened this issue Oct 11, 2018 · 4 comments
Closed

Documentation wrong? #7427

flaushi opened this issue Oct 11, 2018 · 4 comments
Assignees
Milestone

Comments

@flaushi
Copy link
Contributor

flaushi commented Oct 11, 2018

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

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 ;-))

@Ocramius
Copy link
Member

@flaushi yes, that's something that was fixed in doctrine/orm 2.4, where we allowed proxying public properties.

If you want to help with the docs, send a patch to remove that paragraph :-)

stollr added a commit to stollr/doctrine-orm that referenced this issue Oct 18, 2018
In doctrine#7427 @flaushi mentioned the outdated paragraph. This commit removes
this one.
@stollr
Copy link
Contributor

stollr commented Oct 18, 2018

I have created a PR to remove that paragraph ;-)

@flaushi
Copy link
Contributor Author

flaushi commented Oct 18, 2018

Thanks! I wanted to do the same but could not find the paragraph anymore. I tought it had beed deleted already... anyway thanks!

@Majkl578
Copy link
Contributor

#7434 merged.

@Majkl578 Majkl578 added the Bug label Nov 11, 2018
@Majkl578 Majkl578 self-assigned this Nov 11, 2018
@Majkl578 Majkl578 added this to the 2.6.3 milestone Nov 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants