CodeIgniter Forums

Full Version: ORM for CodeIgniter -- DataMapper? Eloquent?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]coderego[/eluser]
It has been recommended to me to use Eloquent as an ORM for CI. I have encountered a good amount of errors with this. Most I have since resolved, but it does seem a bit awkward.

Does DataMappper have all the features that Eloquent does? The website seems to indicate that it is not actively being maintained...in fact I'm not even sure if it is usable with the current version of CI. Is it?

THanks!

El Forum

[eluser]coderego[/eluser]
Or perhaps doctrine?

El Forum

[eluser]WanWizard[/eluser]
[quote author="coderego" date="1365186625"]Does DataMappper have all the features that Eloquent does? The website seems to indicate that it is not actively being maintained...in fact I'm not even sure if it is usable with the current version of CI. Is it? [/quote]

Don't know what gives you that idea. The fact that there isn't a new release every month?

Datamapper has been around for over 5 years, it's very mature, and doesn't need constant updates. It's logical that new alternatives have faster release cycles, they need to fix bugs and add missing features.

The biggest difference between alternatives like Eloquent, Fuel ORM, Doctrine, Activerecord, Propel, etc and Datamapper is that all of them are standalone ORM's. They have their own DBAL (database layer), which means a config separate from CI, different syntax, and no way to work around stuff it it doesn't do what you want (unless you want to hack the ORM's code).

Datamapper on the other hand has been designed to integrate in CI. It uses CI syntax, CI's configuration system, CI's database classes and CI's support classes (like the validation class). So if you're familiar with CI, using Datamapper is a breeze.

p.s. It works fine with the current release (2.1.3). It does not work with the current development version (aka "reactor" aka "3.0"), a lot of the internals have changed which has broken Datamappers CI integration. As nobody has a clue what Ellislabs plans are with CI (current development seems to be completly driven by the community, and one person only in particular), I intend to wait and see what happens. As long as I don't know what the next stable version of CI will look like, I will not make changes to Datamapper (that might impact it's current stability).

El Forum

[eluser]Harold Villacorte[/eluser]
As far as rapid development goes Ci's query builder is faster for me than Doctrine 2. I doubt if Eloquent is as stable as any of the others at this point.

El Forum

[eluser]coderego[/eluser]
What makes the query builder faster than Datamapper?

El Forum

[eluser]Harold Villacorte[/eluser]
I was only comparing Active Record to Doctrine 2, not DataMapper. Doctrine 2 and DataMapper are very different. Doctrine 2 is not bad but from what I have seen it does not speed development any more than using Active Record.