News Feed
Sections




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

Debuggable Blog:
How to bend Cake's Modelfind() method to your needs
June 23, 2008 @ 12:08:32

New on the Debuggable blog, Tim Koschutzki has posted a method to get the fund() method in the CakePHP framework's models to bend to your will.

CakePHP allows you to use your own "find-types" for the Model::find() methodology. Those of your who are familiar with the find() method know that there are currently four types in the core: 'list', 'all', 'first' and 'count'. However, sometimes it is nice to specify your own type.

He shows an example of the end result - a find() call with a custom type that automagically gets translated correctly. His script overrides and enhances the usual find call in an extended object (extended from AppModel) that uses a switch/case statement to define the custom types and their find() search calls.

0 comments voice your opinion now!
cakephp framework find custom type model switch case


blog comments powered by Disqus

Similar Posts

Felix Geisendörfer's Blog: Learning from the CakePHP Source Code (Part 1)

Jared White\'s Blog: Willowgarden & Zend Framework at the same time!

James Morris' Blog: A Symfony2 Console Command and the Foursquare API Venuehistory

PHPMaster.com: 6 Things to Consider when Choosing a Framework

Wokay.com: 12+ Tutorials for creating PHP5 MVC Framework


Community Events





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


interview podcast bugfix list community development conference release threedevsandamaybe zendserver introduction language code deployment framework laravel api tips symfony series

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