Friday, March 25, 2011

how to use counterquery in cakephp

Hi

i need help understanding counterquery

i know right now cakephp allows me to store children count in parent
table

eg a Car hasMany Wheel

so in cars table, there is a wheels_count column.

but i only want to store the wheel associated with a particular car
AND has a status as 'active'.

Meaning, if 5 Wheel records belong to a Car with id = 17, but of these
5 only 3 of them have a Wheel.status = 'active', then the
Car.wheels_count for id 17 is 3.

so apparently counterquery helps me to do this?

Please enlighten me.

Thank you.

--
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
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate