CodeIgniter Forums
activerecord, really? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: activerecord, really? (/showthread.php?tid=60024)



activerecord, really? - El Forum - 12-30-2013

[eluser]Unknown[/eluser]
I'm still new to CodeIgniter and I've been having trouble wrapping my head around the stated idea that CodeIgniter models have anything to do with the ActiveRecord pattern.

From http://www.martinfowler.com/eaaCatalog/activeRecord.html

Quote:Active Record

An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data.

From what I've seen, an instance of a CodeIgniter model class does not represent a row in the database table. Rather, an instance of a CodeIgniter model class might have a method to select a row from the database table and return that row as a simple PHP array.

Am I completely misunderstanding CodeIgniter models?

Thanks.


activerecord, really? - El Forum - 12-30-2013

[eluser]CroNiX[/eluser]
It's not modeled after the "active record pattern". They have changed the name to "query builder" in CI3 to avoid confusion.