-
Notifications
You must be signed in to change notification settings - Fork 0
Mapper Tutorial
This tutorial aims to help newcomers understand how to use the MindFrame2 ORM mapper.
The base mapper is a very simple abstract class which provides very light-weight, yet powerful, ORM functionality. It has the added benefit of utilizing MindFrame2's built-in database abstraction layer.
The main functions to be concerned with when implementing the mapper are the following:
- __construct()
- init()
- load()
- buildWriteData()
The first thing you'll need to know about using the mapper is how to instantiate it. MindFrame2 was built with heavy emphasis on clean interfaces and single responsibility principle, so most of the time, what you see is what you get.
The construct expects three parameters: The DBI, the SQL adapter (abstraction layer), and the mapper pool (can be NULL).
The MindFrame2 DBI is essentially a wrapper for the PDO interface