I apologize if I'm just not finding the right posts in the archives,
but I'm having a problem I'm guessing some of you have had an might
know the answer to.  I've got two models setup as follows:
models/incident.php:
var $hasMany = array(
                'Resident' => array('className' => 'Resident',
                                           'foreignKey' => 'incident_id'));

models/resident.php:
var $belongsTo = array(
               'Incident' => array('className' => 'Incident',
                                          'foreignKey' => 'incident_id'));

I'm trying to search for any incidents with residents who have a given
campus id.  So, in my incident controller, I'm trying to do this:

$this->Incident->findAll(array("Resident.campusid" => "123456", '',
'', '', 1, 2));

When I try this though, rather than recognizing Resident as an
associated model, it just plugs it in as a table name and I receive a
SQL error.  When I remove the search condition (and just do a
recursive search), it finds the associated resident just fine.  Any
guesses on what I might be doing wrong to not have the ability to
search by this associated model?

Thanks a bunch and hopefully this isn't something that gets asked all
the time!

Nathan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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