read() sets the data in the model, find() does not.
http://api.cakephp.org/class_model.html#da9914325847e7a03320eafb691208da

I.e.
$Model->find();
echo $Model->data; // empty

$Model->read();
echo $Model->data; // not empty

Personally I never use read() either.

On 6 Nov 2008, at 17:54, Liebermann, Anja Carolin wrote:

>
> Hello everybody,
>
> I wonder what the difference is between
>
> $this->Hotel->read(null, $id);
> and
> $this->Hotel->findById($id);
>
> Hotel being my model with HABTM relations to a lot of other models.
>
> The returned arrays look the same. Is read just a shortcut for  
> findById?
> Bake put me a lot of "read"s in my code, I personally never use it  
> on my
> own. Am I missing something?
>
> Greetings
>
> Anja
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to