Creating commands, queries, and data transfer objects
In the previous sections of this chapter, we have seen that our controller will need the following commands, queries, and DTOs to be able to manage the blog categories and posts. We can divide them by the entities they enable to manage. That’s why we can create the following folders: /modules/whblog/src/Domain/WHBlogCategory/
and /modules/whblog/src/Domain/WHBlogPost/
. We can then create all the files in both folders, as listed here:
Figure 11.8 – The src/Domain/WHBlogCategory/ and src/Domain/WHBlogPost/ folders
Challenge
The creation of commands, queries, and DTOs was covered in previous chapters. Please create all the previously listed commands, command handlers, queries, queries handlers, and DTOs.
Don’t forget to create the services definition in /modules/whblog/config/services.yml
or in a sub YAML file named commands.yml
or queries.yml
.
As usual, you can check this...