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.
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/
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With