<p>Does anyone have any recommendations for implementations of ActiveRecord in PHP? I've been using <a href="http://31tools.com/cbl_activerecord/" rel="nofollow noreferrer">CBL ActiveRecord</a>, but I was wondering if there were any viable alternatives.</p>

[{'answer_id': 38077, 'author': 'Till', 'author_id': 2859, 'author_profile': 'https://Stackoverflow.com/users/2859', 'pm_score': 2, 'selected': True, 'text': '<p>Depends! ;)</p>\n\n<p>For example there is <a href="http://phplens.com/lens/adodb/docs-active-record.htm" rel="nofollow noreferrer">ADODB\'s Active Record implementation</a>, then there is Zend_Db_DataTable and <a href="http://www.phpdoctrine.org/" rel="nofollow noreferrer">Doctrine</a>. Those are the ones I know of, I am sure there are more implementations.</p>\n\n<p>Out of those three I\'d recommend Doctrine. Last time I checked Adodb carried a lot of extra weight for PHP4 and Zend_Db_* is generally not known to be the best in terms of completeness and performance (most likely due to its young age).</p>\n\n<p>Doctrine aside from Active Table and the general database abstraction thing (aka DBAL) has so many things (e.g. migrations) which make it worth checking out, so if you haven\'t set your mind on a DBAL yet, you need to check it out.</p>\n'}, {'answer_id': 38080, 'author': 'Dave Marshall', 'author_id': 1248, 'author_profile': 'https://Stackoverflow.com/users/1248', 'pm_score': 0, 'selected': False, 'text': '<p>Whilst not strictly ActiveRecord, <a href="http://framework.zend.com/manual/en/zend.db.table.html" rel="nofollow noreferrer">Zend_Db_Table</a>\n is pretty good.</p>\n'}, {'answer_id': 38083, 'author': 'Craig', 'author_id': 1611, 'author_profile': 'https://Stackoverflow.com/users/1611', 'pm_score': 1, 'selected': False, 'text': '<p>I found a few examples of other implementations:\nLuke Baker has one he is calling <a href="http://lukebaker.org/projects/activerecord-in-php/" rel="nofollow noreferrer">Active Record in PHP</a>.</p>\n\n<p>Flinn has a <a href="http://www.actsasflinn.com/articles/2007/08/08/php-and-activerecord" rel="nofollow noreferrer">post</a> about why it is not possible in PHP because in Ruby everything is an object.  With a followup <a href="http://www.actsasflinn.com/articles/2007/08/10/php-and-activerecord-continued" rel="nofollow noreferrer">here</a></p>\n\n<p>I know a few people who have looked at <a href="http://framework.zend.com/" rel="nofollow noreferrer">ZF</a> have you tried that?</p>\n\n<p><a href="http://cakephp.org/" rel="nofollow noreferrer">CakePHP</a>?</p>\n'}, {'answer_id': 38097, 'author': 'Patrick Hogan', 'author_id': 4065, 'author_profile': 'https://Stackoverflow.com/users/4065', 'pm_score': 1, 'selected': False, 'text': "<p>This is more of a how-to-implement tip, but I started dabbling with creating an ActiveRecord/DataMapper implementation in PHP and quickly ran into many hurdles with array-like access. Eventually I found the SPL extensions to PHP, and particularly ArrayObject and ArrayIterator. These began to make my life a lot easier. Unfortunately I haven't had much time to devote to it, but anyone who tries something like this should check those out.</p>\n"}, {'answer_id': 6012537, 'author': 'Jamon Holmgren', 'author_id': 204044, 'author_profile': 'https://Stackoverflow.com/users/204044', 'pm_score': 3, 'selected': False, 'text': '<p>I realize this is old, but there is an absolutely fabulous PHP Activecord library called, appropriately, PHP Activerecord. I\'ve used it for several months and it blows away the other libraries.</p>\n\n<p>Check it out:</p>\n\n<p><a href="http://www.phpactiverecord.org/">http://www.phpactiverecord.org/</a></p>\n'}]
['https://Stackoverflow.com/questions/37979', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/393028/']