News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Matt Curry's Blog:
On The Fly Model Chains With CakePHP
April 17, 2009 @ 11:13:52

Matt Curry has come back and posted yet another method you can use to help speed up your CakePHP applications that need chained methods (as he mentioned before) - only loading the parts as they're needed.

The smart readers (which is really all of you guys. you're the best) probably realized that there is a lot of overhead in building the chain, especially for apps with lots of interlinked models. Wouldn't it be awesome if Cake only created the pieces of the chain as needed?

He's created a sample model to do just that - it removes all model associations previously set (so it doesn't auto-build the chain) and then only adds in the models it needs (as defined in the __loadAssociations array) and then calls the parent constructor to autoload just those. A few benchmarks are tossed in comparing a model with no chains versus one with a varying number (one/nine).

0 comments voice your opinion now!
cakephp model chain custom load


blog comments powered by Disqus

Similar Posts

Refulz Blog: Yii Framework - Scenarios for Conditional Multiple Validation Rules

Chris Hartjes' Blog: Converting Legacy Apps to CakePHP, Part 3

Padraic Brady's Blog: Zend Framework: Surviving The Deep End, Chapter 3 - The Model Available

Leaseweb Labs Blog: Tuning Zend framework and Doctrine

Tim Koschuetzki's Blog: How To Transform HTML To Textile Markup - The CakePHP TextileHelper Revisite


Community Events





Don't see your event here?
Let us know!


threedevsandamaybe library api code interview podcast application developer release laravel community configure bugfix install series list language introduction symfony wordpress

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework