Hello all

As for now into Phalcon version 2.x have to support subqueries and in order to use it, you just following like example below:

$phql = "SELECT c.*
  FROM Shop\Cars c
  WHERE EXISTS (
     SELECT id
     FROM Shop\Brands b
     WHERE b.id = c.brandId
  )";
$cars = $this->modelsManager->executeQuery($phql);