Skip to content
archwisp edited this page Jul 29, 2011 · 1 revision

This tutorial aims to help newcomers understand how to use the MindFrame2 ORM mapper.

MindFrame2_Dbms_Record_Mapper_Abstract

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()

__constrct()

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

Clone this wiki locally