Hi.
I use query builder with subquery in conditions. It created this PHQL
SELECT hotel.id AS [hotel_id], hotel.name AS [hotel_name], hotel.full_sort AS [full_sort], hotel.our_sort AS [our_sort], hotel.rate AS [rate], geo_request_hotels.distance AS [distance] FROM [\My\Models\Hotel] AS [hotel] JOIN [m:SearchGeoRequestHotels] AS [geo_request_hotels] ON geo_request_hotels.hotel_id = hotel.id JOIN [m:SearchGeoRequest] AS [geo_request] ON geo_request.id = geo_request_hotels.request_id WHERE geo_request.hash = 'fcc05f879a29018badc45fee03ca2182ff726930e5475da53a07bc242fc8992b' AND hotel.id IN (SELECT he.hotel FROM [\My\Models\HotelEquip] AS [he] WHERE he.equip = 56) ORDER BY [full_sort] DESC
When I try to run it I get error:
Phalcon\Mvc\Model\Exception: Can't obtain model's source from models list: 'My\Models\Hotel', when preparing ...
So if a remove square brackets from [\My\Models\Hotel] it runs perfectly. Or I remove subquery "hotel.id IN (SELECT he.hotel FROM [\My\Models\HotelEquip] AS [he] WHERE he.equip = 56)". It also runs perfectly. So the problem is in parsing and dealing with subqueries.
I can't get rid of query builder since I use pagination query builder adapter. Any suggestions? It seems a bug.