How to avoid setters using symfony with admin panel maker?

I want to avoid getters / seters hell in my entities (here's why: http://ocramius.imtqy.com/doctrine-best-practices/#/53 ), but also the most popular admin admin panel:

need recipients and setters to visualize the view.

My idea is to create a DTO object instead ( http://ocramius.imtqy.com/doctrine-best-practices/#/57 ) and then use named constructors to create the entities. I want to call named constructor inside my service. What is the best way to get admin panel generators to use my DTOs to save / update data, can you give me an idea and / or best practice example in this case?

The only way I imagined was to use DTO instead of real Entity, call intercept prePersist / preUpdate and use a custom service, but that seems confusing.

+4
source share
1 answer

DDD ( ) .

, CRUD . , CRUD BC. BC, , , .

, , , . - , , , .

+1

Source: https://habr.com/ru/post/1627806/


All Articles