Hi all, I’ve a 5 models related, in one action I must retrieve all relations model structure (all self::HAS_MANY) then:
$criteria->with(‘model_B’);
$criteria->offset = 0;
$criteria->limit = 10;
$criteria->together = true;
I call a final $model_A->findAll($criteria);
the final dataTable(jquery object) show 10 records of modelB not modelA, if first and second row have 5 record joined, then the dataTable show me only two rows !! (5+5 = 10 the $criteria->limit)
if I remove that clause (together=true), I lose the ability to read data models connected through relationships (es. $modelA->modelB->ModelB_attribute …
yes I’ve association by relations in my model. What do you mean?
mainModel(){
public function relations(){
'rel_A' =>array(.......)
'rel_B' =>array(......., through => 'rel_A')
'rel_C' =>array(......., through => 'rel_B')
}
}