there is  "counter cache" counter_cache property. check manual.

On May 14, 4:41 pm, "Bogdan I. Bursuc" <bogdanbursu...@gmail.com>
wrote:
> I have the following model:
>         categories:
>                 - id,
>                 - parent_id,
>                 - name,
>                 - product_count
> So, the model is threaded: exists main categories and subcategories
> that's it, but only subcategories contain products so only for
> subcategories product_count will be incremented.
> My question:
>         Is there a way in cake so that when i do a find on the main categories
> to obtain the number of products in all it's subcategories.
>
> Thx.
--~--~---------~--~----~------------~-------~--~----~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to