If you're doing the select in Model1, you need to limit the fields in
Model2 in the association, as follows:
class Model1 extends AppModel {
var $hasMany = array("Model2" => array("fields" => "Model2.field1,
Model2.field2"));
}
Then, you only need to get the Model1 fields when doing the query:
$this->Model1->findAll(null, array('model1.field','model1.field2'));
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---