When I have a PHP model or collection of a Magento entity (such as a product or customer), what PHP class(es) is in charge of constructing and executing the SQL that selects that model or collection of models from the database?
In most circumstances, entity models inherit from
AbstractModel, resource models, which serves as an adapter between an entity model and ORM, inherit from
AbstractDb, and collections inherit from
Take a look at the following classes: