Hi all,
I have 3 models: Company, Site and Country. All relations are set
properly.
Company hasMany Site
Company belongsTo Country
Site belongsTo Country
Using the Containable Behavior find queries and pagination works well,
except one thing: I can't get conditions to work that are related to
the contained models.
The following code shows how I paginate the Company model. But how can
I specify that I only get companies that have at least one site? Or
how is it possible to get only companies who have at least one site in
Germany?
$this->paginate = array(
'contain' => array(
'Country' => array(
'name',
'region',
'continent'
),
'Site' => array(
'fields' => array(
'id',
'name'
),
'Country' => array(
'name',
'region',
'continent'
)
)
)
);
Thanks,
Markus
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---