On Dec 11, 4:12 am, "Erich C. Beyrent" <[EMAIL PROTECTED]>
wrote:
> This insight is truly helpful, however, my associations are a little
> different.
>
> I have an Offer which belongs to a resort.  A Resort belongs to both a
> State and a Destination, and hasMany Offers.  Both States and
> Destinations hasMany Resorts.  There is also a secondary association
> between Resorts and States where a Resort can be associated with many
> states.
>
> What I am trying to do is a findAll on my Specials, but have them
> grouped by Destination.

So in other words you don't want a GROUP BY at all ;).

// Use unbindModel to get rid of unneeded associations before running
// Use bindModel to define any associations or constraints on the
associated models.
$results =
$this->Offer->Resort->Destination->findAll($DestinationAndOrResortConstraint,null,'Destination.name
ASC',null,null,2);
pr ($results); die;

That should get you a step closer. The array will of course be a
different structure from doing a find on offer, but the results will be
approx. what you are looking for.

HTH,

AD7six
Please note:
The manual/bakery is a good place to start any quest for info.
The cake search (at the time of writing) erroneously reports less/no
results for the google group.
The wiki may contain incorrect info - read at your own risk (it's
mainly user submitted) :) You may get your answer quicker by asking on
the IRC Channel (you can access it with just a browser
here:http://irc.cakephp.org).


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" 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