I have wrote universal script to get all rows from Doctrine Table Models, but if rows amount is too large, i get exception:
Cannot define NULL as part of query when defining 'offset'.
Running script:
$table = new JV_Model_StoreOrder();
$this->data['list'] = $table->getTable()->findAll()->toArray();
I understand from the error above is due to the large number of entries in the table (> 20 000). So I decided to make a paginator to break records on the pages of 100 pieces.
Could you help me, how can I do something like that:
...
$total_amount = $table->getTable()->count();
$this->data['list'] = $table->getTable()->offset(0)->limit(100)
->findAll()->toArray();
...