O'Reilly logo

CakePHP 1.3 Application Development Cookbook by Mariano Iglesias

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing a custom find type

The recipe, Searching for all items that match search terms, gives us a great starting point to create a custom find type. Custom find types allow us to extend the basic find types any model has, allowing our code to become more readable and extensible.

This recipe shows how to create a custom find type to allow the Post model to be searched against a set of terms, thus extending the functionality shown in the previous recipe.

Getting ready

We need some sample models and data to work with. Follow the Getting ready section of the recipe, Performing GROUP and COUNT queries.

How to do it...

  1. Open the post.php file and add the search find type to the list of find methods using the _findMethods property, together with the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required