jpfuentes2/php-activerecord — pull request #414 by shmax (2014-06-27 22:22:12+00:00)
Title: Add model caching support

Caching of models has been promised in the documentation for php active record for a long time (see http://www.phpactiverecord.org/docs/ActiveRecord/Config), but somehow it has never appeared. I spent a few days trying to work it in from my external code, but I couldn't quite get it to work without changing a few members in Table to protected, so I figured as long as I need to touch the code I may as well go for full support.

So, this change provides basic caching functionality at the model level. If you set a static member called $cache to true on your model, then active record will try to fetch it when retrieving individual records, and set it when calling save().