criteria limit issue

Hi all, I’ve a 5 models related, in one action I must retrieve all relations model structure (all self::HAS_MANY) then:


$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)


take out this from your criteria

$criteria->together = true;

if the above does not work, uncomment the following in your config/main.php and look for the query executed paste the query here






if I remove that clause (together=true), I lose the ability to read data models connected through relationships (es. $modelA->modelB->ModelB_attribute … ;)


do you have association declared in your model? if so that should not effect how you access the related properties

:mellow: yes I’ve association by relations in my model. What do you mean? :blink:


 public function relations(){

  'rel_A' =>array(.......)

    'rel_B' =>array(......., through => 'rel_A')

       'rel_C' =>array(......., through => 'rel_B')