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

Avoid Entities #778

Closed
chiqui3d opened this issue Feb 15, 2018 · 9 comments
Closed

Avoid Entities #778

chiqui3d opened this issue Feb 15, 2018 · 9 comments

Comments

@chiqui3d
Copy link

chiqui3d commented Feb 15, 2018

Is it not possible to avoid generating or creating getters and setters for columns that do not have to be modified?

It really doesn't make any sense to create getters or setters that are not going to be modified in the final result. I think this option would be very useful.

@Ocramius
Copy link
Member

Entity generator and surrounding facilities have been deprecated and removed from the next ORM major release, and they will not be improved.

doctrine/orm#6870

@chiqui3d
Copy link
Author

chiqui3d commented Feb 15, 2018

I was also speaking in terms of ORM, that is, because writing in the entity.php if you are not going to make modified results(set and get), by default the ORM should have it. And ORM is to improve this type of situation, to make you write something that is not going to be modified is prehistoric.
Thanks anyway.

@Ocramius
Copy link
Member

@chiqui3d at this point in time, the ORM core team is unanimous about the opinion that entities should not be generated, but designed.

Even read-only objects need that (typical example: lookup read-only tables).

@chiqui3d
Copy link
Author

I don't understand how doctrine does it automatically for setID and not for the other columns, it's primitive.

I just created 50 column and I have to go one by one writing setColumn() and getColumn(), I'm not saying that they are generated, I say Doctrine knows that if in the entity there is no getColumn or a setColumn, Doctrine use one in its default.

@Ocramius
Copy link
Member

@chiqui3d doctrine does never touch the public API of your methods: it uses reflection to set/get data from your objects.

@JarJak
Copy link

JarJak commented Jun 8, 2018

doctrine does never touch the public API of your methods: it uses reflection to set/get data from your objects.

@Ocramius this behaviour should me mentioned in docs (if it hasn't been there already) this is not obvious and a lot of people are asking for this

@Ocramius
Copy link
Member

Ocramius commented Jun 8, 2018 via email

@JarJak
Copy link

JarJak commented Jun 8, 2018

@Ocramius here you go: doctrine/orm#7253

@Ocramius
Copy link
Member

Ocramius commented Jun 9, 2018

Thanks @JarJak!

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

No branches or pull requests

3 participants