DataMapper is an Object Relational Mapper written in PHP for CodeIgniter. It is designed to map your Database tables into easy to work with objects, fully aware of the relationships between each other.
- Everything is an object!
- Easy to setup, easy to use.
- Custom Validation on object properties.
- Lazy Loading (related objects are only loaded upon access).
- Relations and their integrity are automatically managed for you.
- One to One, One to Many, and Many to Many relations fully supported.
- Select data in the style of Active Record (with or without Method Chaining).
If you are new to Datamapper ORM, please start here to get Datamapper ORM running on your server. Then follow along with the Next Topic links at the bottom of each page.
Note: Datamapper ORM is now also available as a CI Spark: check out the cool way of extending CodeIgniter at getsparks.org!
This is the latest incarnation of the Datamapper library. After Phil had indicated he no longer had the time available to support his OverZealous Edition, Datamapper ORM is now being developed and maintained by WanWizard.
DataMapper, OverZealous Edition
This came from a desire to continue to enhance and develop DataMapper, and has been developed and maintained by Phil DeJarnett. DMZ is a near drop-in replacement if you are already using DataMapper 1.6.0 (and possibly older versions).
The Original DataMapper
DataMapper (for CodeIgniter) was originally developed by Simon Stenhouse. The basic design and original development was by him.
Some of the enhancements to the original DataMapper include:
- In-table foreign-keys for singular relationships.
- The ability to view, edit, and query using extra columns on relationship join tables.
- The ability to include data from singularly related objects.
- The ability to query and include data from deep relationships.
- Significantly enhanced relationships, including multiple relationships between the same objects.
- The ability to extend Datamapper ORM through simple classes, and share those extensions.
- The ability to process subqueries, work with SQL functions.
- Lots of little improvements, such as default ordering, saving objects with existing ids, query grouping, performance improvements, and much more.
If you would like to upgrade to Datamapper ORM from DMZ or the original DataMapper, please see the upgrade guide.
If you use DataMapper in your applications, please consider donating to support the ongoing development, maintenance and support of DataMapper. Any amount is highly appreciated.
You can donate via PayPal using the button in the upper-right corner of the page.
Are you looking for some custom development for DataMapper? Do you need an experienced PHP developer that knows both DataMapper and CodeIgniter inside and out to help you build your application?