Welcome Guest, Not a member yet? Register   Sign In
[ASK] Why using ORM?
#2

[eluser]ipsod[/eluser]
The active record class provided by CI isn't an ORM like PHPActiveRecord.

ORM classes give cool features like:
Code:
$p = new Product();
$p->where_related_category('title', 'Marbles')->get(10);
which fills $p with an array of the first 10 product entries where the related category's title is "Marbles". Isn't that awesome? (In the example "category" is a related database, "title" is a field in the "category" database, and "Marbles" is a specific entry in the title field)

No, it's not less secure if you do it right. It's slightly slower (adds about .01 seconds on my server), since it has to build a somewhat complex object, but well worth it for my purposes, especially since I cache everything large to the file system as things are entered to the database.

I use DMZ, which is built on top of CI's active record and built according to CI's design goals (low overhead, high speed, simple, etc.), and recommend it.


Messages In This Thread
[ASK] Why using ORM? - by El Forum - 04-01-2011, 07:07 PM
[ASK] Why using ORM? - by El Forum - 04-01-2011, 11:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB