One of the best features of API Platform is the ability to add #[ApiResource] above an entity and… bam! You have a fully-functional API! Though, if you want to have full control and peak clarity, nothing beats creating a dedicated DTO class.
But, creating a DTO class - especially when the data comes from Doctrine - feelslike reinventing the wheel! Suddenly you need to create a state provider, stateprocessor and filters… which all do the same thing that API Platform does automatically for entities.
No more! In this talk, we’ll explore a new feature called “state options” that gives you the flexibility of a DTO class, but the convenience of an entity. We’ll explore how this works & exactly what you need (e.g. a mapper system) to create a DTO class and have it “just work”.
_________
More info: https://api-platform.com/con/2023/
X/Twitter: / apiplatform
Music credits: Solar Flare, Adi Goldstein
Смотрите видео API Platform Conference 2023 - Ryan Weaver - Create the DTO system of your dreams онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Les-Tilleuls.coop 10 Ноябрь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 3,254 раз и оно понравилось 98 людям.