$items is a query from $this->modelsManager->createBuilder()
I have now:
$query=$this->modelsManager->createBuilder()
->from('Articles')
->innerJoin('Categoryarticles','Articles.id=Categoryarticles.articleid')
->innerJoin('Categories','Categoryarticles.categoryid=Categories.id')
->where('Articles.languagekey=:languagekey:',array('languagekey' => $this->languagekey()))
->andWhere('Articles.trash=:trash:',array('trash' => 'no'))
->andWhere('Articles.publishdate<=:date:',array('date' => date('Y-m-d')))
->andWhere('Articles.expiredate>:date:',array('date' => date('Y-m-d')))
->andWhere('Categories.trash=:trash:',array('trash' => 'no'))
->andWhere('Categories.languagekey=:languagekey:',array('languagekey' => $this->languagekey()));
If I have at least one result, no errors occured.
If no results, I get the error.
The query mentioned here works fine.
Using
$paginator=new Phalcon\Paginator\Adapter\Model(
array(
"data" => $items,
"limit" => 10,
"page" => $this->request->Get('page')
)
);
Does not give any problems, but honestly I don't like the solution with Phalcon\Paginator\Adapter\Model over more than 10000 records.