Hi,

i have 2 models that are connected between each other with hasOnes:

- ModelA

var $hasOne = array(
     'ModelsB' => array(
     'classname' => 'ModelsB',
     'foreignKey' => modelA_id,
...

- ModelB

var $hasOne = array(
     'ModelsA' => array(
     'classname' => 'ModelsA',
     'foreignKey' => id,
...

If i now make a read($id, null) in modelA_controller i get an array
with the data of modelA and the data of its modelB. Looks correct.
But vice versa it doesn't work: I get the data of modelB, but not of
its modelA, but data of a modelA with the same id as modelB has.
The query explains why: ... LEFT JOIN modelA AS modelsA ON (ModelA.id
= ModelB.id) ...
I have to change something in the hasOne-Relation of ModelB? But why
it works then in one direction?

Thanks for your help :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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