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

Can't obtain model's source from models list (solved)

Hello, the follow code results is: Can't obtain model's source from models list: 'Model\Api3rdProduct', when preparing: SELECT [\Model\Api3rdProduct].* FROM [\Model\Api3rdProduct] WHERE id IN (:AP0:, :AP1:, :AP2:)

Any help please:

$products=$this->modelsManager->createBuilder() ->from('\Model\Api3rdProduct') ->inWhere('id', [1,2,3]) ->getQuery() ->execute();



3.2k
Accepted
answer

Solution:

$products=$this->modelsManager->createBuilder() ->addFrom('\Model\Api3rdProduct','m') ->inWhere('m.id', [1,2,3]) ->getQuery() ->execute();