At this point, your main class,
mymodcomments, should be of almost 300 lines. The following section is not a PrestaShop best practice; beware! During the next chapter, I'll use the module with hook controllers.
This is how I chose to split my code to have hook actions in a separate class. You can choose to do it differently (or not at all, in which case, you can skip this section).
I have attached two versions of the module with this chapter:
mymodcomments: This is the module you should have now
mymodcomments_with_hook_controllers: This is what the module should look like once you add the hook controllers
We will create one controller for each part of our module. For example, in the case of the
displayProductTabContent hook, we have coded three methods: