If you have a model with many associations, debug out the results of read() - 
and you'll be amazed at how much it pulls back. I never use it.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 13 Oct 2011, at 12:02, WebbedIT wrote:

> read() also can put you in strange situations as it loads whatever
> data it fetches into the model's data array, so as euromark says,
> start using find instead.
> 
> HTH, Paul.
> 
> On Oct 12, 11:45 am, euromark <[email protected]> wrote:
>> a) you never need read() - i dont use read() once for over 3000
>> actions.
>> i favor always the find() due to its advantages like contain and
>> fields
>> you just need to remember to always pass along the id (which would
>> read do automatically)
>> 
>> b) updateAll() is atomic and does exactly want you want.
>> 
>> On 12 Okt., 11:34, cakii <[email protected]> wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> Hi everyone,
>> 
>>> i start think bout performance, traffic, aweseom code etc.
>>> i have a few *find *commands in my model, depending on the flow 3-6 'little'
>>> *finds*, sometimes *field *only.
>>> depending on the request flow, in the worst case all data /finds is needed
>>> -> read equivalent
>> 
>>> do you think its wiser, make one 'big' *read* (20 fields in one model and in
>>> correspondning model betwenn 5 and about 50 fields) *everytime *and using 
>>> *model->
>>> data *for further actions instead of the more or less find calls ?
>> 
>>> ..
>>> another little question:
>> 
>>> whats the best way to raise an int field in a database in cakephp, like:
>>> UPDATE foo SET bar = bar+1
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to