Introduction to service contracts in Magento
Introduction to Magento service contracts DTOs repositories and REST API endpoints explained.
Lesson Content
Weβve learned about models, resource models, and collections, which are the main parts of the data layer responsible for handling entities and sorting and retrieving them from a database. This works fine in your own custom code, but itβs often better to abstract away direct database calls and rely on code that looks like a publicly facing API instead.
This is the responsibility of a repository, which is another abstraction that sits on top of the other parts of this data layer. Since resource models may contain implementation-specific code such as calling a particular type of database, reposi...
Join the discussion!
Comments
Want to comment on this lesson?
Enroll in this course to leave comments.