Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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();



2.9k
Accepted
answer

Solution:

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