I would like to know if it is possible to avoid using getters and setters for a Symfony 2 entity. Although the php app/console doctrine:generate:entities is very helpful, line codes seem to increase a lot for an entity with a lot of fields
Share
You Code won’t work properly if skip getters and setters.
Especially if you have mapping with different Entities.
Doctrine uses getters nad setters to populate various members fields during storing and fetching of information
Its very bad practice to use public for every property in Entity.
and also you will end up wasting lot of time in changing the property to public as doctinr uses proted when it autogenerate the code