I am new at this and learning new things all the time and trying them out..
I came across finderQuery and was wondering if i set up the finderQuery in a
model such as this example I found online
 
'finderQuery' => 
                                        "SELECT ". 
                                                "Airport.id, ". 
                                                "Airport.name, ". 
                                                "Airport.city, ". 
                                                "Airport.identifier, ". 
                                                "COUNT(Change.id) AS
changes, ". 
                                                "State.abbrev ". 
                                        "FROM ". 
                                                "airports AS Airport ". 
                                                "JOIN states AS State ON 
(Airport.state_id = State.id) ". 
                                                "LEFT JOIN changes AS
`Change` ON 
(`Change`.airport_id = Airport.id) ". 
                                                "JOIN books_airports ON
(Airport.id 
= books_airports.airport_id) ". 
                                        "WHERE ". 
                                                'books_airports.book_id = 
{$__cakeID__$}'. 
                                        "GROUP BY Airport.id " 
        ) 
    ) 
 
 
This gets me all the info in 1 query....perfect. But if I needed to find say
just the 
"Airport.id, ". "Airport.name, ".  "Airport.city, ". Or add an additional
field such as "Airport.int_code, ". to get data from on a different page
would I use a custom find('list', array('conditions'......)):

And would that only pull the info requested or will it tie into the
finderQuery and pul lall that data?

Find would get me all the info from the finderQuery and find('list/first??',
array('conditions'......)): would let me over ride the finderQuery?

Thanks,

Dave


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