I'm looking for a solution to this same problem.

My setup is something like this:
Job belongsto User
User belongsTo Address

I want to do a find all on Job and order by a field in Address.

Would love to hear from someone on how to handle this scenario.

Thanks,
Nick

Hi Group!

I'm about to go crazy on this one:

A rough sketch of my models, I have Sale belongsTo Emission which in
turn belongsTo EmissionType
Doing Sale->findAll(null, null, 'EmissionType.name ASC', null, null, 3)
wont work...:

Unknown table 'EmissionType' in order clause

The recursion works fine, findAll returns all levels, I can access them
in my view with $data['Emission']['EmissionType']['name']. The
associated levels are added in subsequent queries, as debug shows, but
in my initial query, the table is not available.

My Sale model has the following fields: id, emission_id, bank_id, date,
volume.

What I am  trying to achieve is sorting of the results table by
clicking on the header (a quite common task...) This works fine as long
as the field is in the table Sales (e.g. date or volume) but not on
assiciated field...

I tried bindModel to bind Sales directly to EmissionTypes but the
resulting query got even worse...;(

Anyone encountered such difficulties? Searching the group didn't throw
any matches...

Any suggestions are appreciated.

Greetings

frank


--~--~---------~--~----~------------~-------~--~----~
 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