jokobjp,

Here is an example from one of my first cakephp projects.  My models
are similar, in that Projects hasMany Tracts, Tracts have an "acres"
field.

When I query for Projects, the projects include a 'total_acres' field
which is a summation of the Tract acres.

http://bin.cakephp.org/view/1844087313

I think the way Set::extract has been deprecated in more recent
releases.

-teh

On May 24, 8:34 am, jakobjp <m...@jakobjp.net> wrote:
> I have a model Event that hasMany Ticket.
> Ticket has a field called "price".
>
> I would like to accomplish that Event gets an attribute
> "total_ticket_price", which is the sum of "price" for all of Event's
> Tickets.
>
> I have been trying to looking into the afterFind() method, but I have
> been unable to accomplish this.
>
> Your help is much appreciated.
--~--~---------~--~----~------------~-------~--~----~
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