I have the following relationship in my models
BasicIndexing belongsTo Applicant
Applicant hasMany Request
As such I would like to retreive the BasicIndexing model and contain the Applicant Model and an applicants corresponding request as shown in the code below
$fullCondition = array(
'contain' => array(
'Applicant' => array(
'Request',
'fields'=>array('Applicant.surname','Applicant.first_name','Applicant.id')
)
),
'conditions' => $conditions,
'fields'=>array('BasicIndexing.application_date','BasicIndexing.application_number')
);
$this->loadModel('BasicIndexing');
$searchResult = $this->BasicIndexing->find('all',$fullCondition);
The problem is that the result returned into $searchResult
does not contain the Request model at all. It only contains the Applicant model and ignores the Request model. I tried using a model that is not associated with Applicant and i get the warning that the model is not associated to the Applicant model.
Array
(
[0] => Array
(
[BasicIndexing] => Array
(
[application_date] => 2012-04-17
[application_number] => BIA170420124356
)
[Applicant] => Array
(
[surname] => Kermit
[first_name] => Frog
[id] => 4f8d3b63-c2bc-48a1-9fb5-0290c982293d
)
)
)
Is there anything im doing wrong or there is a problem with the cake 1.3.0 release?
Any help would be highly appreciated.
Thanks.