Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which ORM for codeigniter? [closed]

The quote below has convinced to finally go ORM. In the past I havn't really liked ORM and wrote it off as a stupid way of doing sql. Dealing with hierarchical data in sql is a pain I don't want to deal with.

There's a reason we have these “Object-Relational Mapper” things, and it's because of a problem known as the Object-Relational Impedance Mismatch. Basically, the formal mathematical model for databases used to ensure that they stay intact follows a system of tables with rows and columns and references to other tables, while data structures in most programming languages we use today manipulate data in nested tree-like structures. It's rather like the difference between a spreadsheet and an XML document, or between a ledger and a family tree diagram. - http://zork.net/motd/nick/django/your-favorite-orm-sucks.html

I want something with minimal effort to setup. Most of my project are small so I don't want to spend much time defining models when I only use them for few queries.

I'm using codeigniter as the php framework and MySQL as the database.

like image 756
Keyo Avatar asked Aug 09 '10 07:08

Keyo


2 Answers

Doctrine is brilliant and very easy to setup and use with CI. There are three ways of integrating it 1) the way described in the CI wiki 2) as a plugin 3) using hooks. I don't like option 1 as it involves messing with CI system files. Option 2 is very easy and what i currently use. Setup is described at www.phpandstuff.com. I've never tried option 3 but it sounds interesting - http://blog.medryx.org/2008/10/04/codeigniter-and-doctrine/

like image 109
musoNic80 Avatar answered Oct 12 '22 02:10

musoNic80


I think you should try the DataMapper ORM which is written in native CI Also easy to configure and easy to use as well. I think it's better than Doctrine.

like image 41
tlarevo Avatar answered Oct 12 '22 01:10

tlarevo