Hi All,
I am new to Cake 1.2, (dabbled with 1.? a year ago, but spend more
time with Rails..) I am really getting into this framework, it is
really fun, much better than earlier versions.

I am however stuck with a problem relating to model associations:

Consider the following in my Contract model

...
                        'Attorney' => array('className' => 'AddressBook',
                                                                'foreignKey' => 
'transfer_attorney_id'
                                                                'conditions' => 
"Attorney.tags LIKE '%attorney%'"
                        ),
                        'BeetleInspector' => array('className' => 'AddressBook',
                                                                'foreignKey' => 
'beetle_inspector_id',
                                                                'conditions' => 
"BeetleInspector.tags LIKE '%fumigation%'"
                        ),
                        'ElecInspector' => array('className' => 'AddressBook',
                                                                'foreignKey' => 
'elec_inspector_id',
                                                                'conditions' => 
"ElecInspector.tags LIKE '%electrical%'"
...

Now when I do this in my contracts_controller the Model is returning
ALL the records from AddressBook for each of the vars:

                $transferAttorneys = $this->Contract->Attorney->find('list');
                $beetleInspectors = 
$this->Contract->BeetleInspector->find('list');
                $elecInspectors = $this->Contract->ElecInspector->find('list');
                $this->set(compact('beetleInspectors', 'elecInspectors',
'transferAttorneys'));

What am I doing wrong?

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to