PostIT

while scratching my head…

CakePHP – Find, FindAll, Find(‘all’), Read September 10, 2008

Filed under: CakePHP, PHP — Remo @ 10:37 am
Tags: , , ,

Use Model::read() when you have the ID, ie: you know the record you are referring to. Also read() will populate the Model::$data in a way suitable for Model::save() while find() will simply return the resultset array.

Use find() / findAll() / find(‘all’) to find records.

Both methods should fetch associated models given the correct Model::$recursive value.

Model::read is only a wrapper for Model::find

Source:

http://n2.nabble.com/Difference-between-read-and-find-td726658.html

 

Leave a Reply