I suspect this to be a pretty common thing to do, so I hope someone
can let me know how ;-)


On May 24, 11:22 pm, Teh Treag <[email protected]> wrote:
> jakobip,
>
> What do you have $this->Event->recursive set to?  Are the associations
> done correctly?
>
> -teh
>
> On May 24, 9:12 am,jakobjp<[email protected]> wrote:
>
>
>
> > Hmm, I'm not sure I follow the example. At least it didn't help we to
> > resolve this - probably because of lacking skills on my part :-(
>
> > When I add the following afterFind() function to my Event method...
>
> > function afterFind($events) {
> >   foreach ($events AS $event) {
> >     pr($event);
> >   }
>
> > }
>
> > ... I would expect the outputted Event array to hold a sub-array
> > containing it's related Tickets. However, that's not the case. It just
> > looks like this (no sign of the Tickets):
>
> > Array
> > (
> >     [Event] => Array
> >         (
> >             [id] => 2
> >             [user_id] => 7
> >             [title] => Testevent
> >             [created] => 2009-05-24 12:51:32
> >             [updated] => 2009-05-24 12:51:32
> >         )
> > )
>
> > How do I get access to the Tickets, so I can perform a calculation on
> > the "price" field (i.e. generate the Event.total_ticket_price value)?
> > And, wouldn't it be better for performance to include the
> > Event.total_ticket_price value directly in the SQL query somehow?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
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