We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

createBuilder with Phalcon\Paginator\Adapter\QueryBuilder error

In controller

$builder = $this->modelsManager->createBuilder() ->from(array('p' => '\Blog\Models\Posts')) ->leftJoin('\Blog\Models\PostsTranslation', 't.id = p.id', 't'); echo $sql = $builder->getPhql();

SELECT [p].* FROM [\Blog\Models\Posts] AS [p] LEFT JOIN [\Blog\Models\PostsTranslation] AS [t] ON t.id = p.id

When i call. It return Model '' could not be loaded

$paginator = new PaginatorQuery(array( "builder" => $builder, "limit" => $limit, "page" => $numberPage )); $this->view->page = $paginator->getPaginate();

Try to remove first \

$builder = $this->modelsManager->createBuilder() ->from(array('p' => 'Blog\Models\Posts')) ->leftJoin('Blog\Models\PostsTranslation', 't.id = p.id', 't'); echo $sql = $builder->getPhql();


2.8k

It fixed with 1.3.4. Current version 1.3.3