When you want to save data in a module, you may want to store that in a custom entity. That entity needs a database table and a model that talks with that database table.
We will create a subscriptions entity where we can store subscriptions.
In this recipe, we will extend the module of Chapter 4, Creating a Module, with an entity with a database table. Make sure you have the starter files for this recipe installed.
In the next steps, we will learn how we can add entities to an existing module:
app/code/Packt/HelloWorld/Model/ResourceModel/Subscription.phpwith the following content: