Hello together,
i have two models, hasOne(Model2) hasMany(Model1) connection
now i try to search over an id in model1 the data in model2.
i try it in this way
$this->set('var1',$this->Model1->find('first', array(
'conditions' => array('Model1.id' => $id),
'recursive' => 2,
'fields' => array('Model1.foreignkey_id','Model2.id')
)));
The column Model2.id is unknown.
But it in the table.
But if i try the other controller (Model2) it still runs
$this->set('var2', $this->Model2->find('first', array(
'conditions' => array('Model1.id' => $id),
'recursive' => 2,
'fields' => array(
'Model2.wishlist_id',
'Model2.id',
'Model2.title',
'Model1.id',
'Model2.id',
'Model2.description',
'Model2.reservation_status',
)
)
)
);
In this case it runs normally. How do i get it that a can found in all
controller, without an searchindex
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
To unsubscribe from this group, send email to
cake-php+unsubscribegooglegroups.com or reply to this email with the words
"REMOVE ME" as the subject.