Summary

In this chapter, we first learned how to create simple model, its resource, and collection class. Then we did the same for an EAV model. Once we had the required model, resource, and collection classes in place, we took a detailed look at the type and flow of schema and data scripts. Going hands-on, we covered InstallSchema, UpgradeSchema, InstallData, and UpgradeData scripts. Once the scripts were run, the database ended up having the required tables and sample data upon which we based our entity CRUD examples. Finally, we took a quick but focused look at collection management, mostly comprising filtering collection to get the desired result set.

The full module code can be downloaded from https://github.com/ajzele/B05032-Foggyline_Office ...

Get Magento 2 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.