I'm following problem. I need to run a query in the CLI, however this query must be performed in various databases. I change the database directly into the Model with setConnectionService($db) as in:
$obj = new MyModel1();
$obj->setConnectionService($db);
but I need to change the database in a query with join. I could not change the source of Phalcon\Mvc\Model\Query\Builder. I need to run a query like:
$obj = (new Builder())->from(array('m1'=>'MyModel1'))
->innerJoin('MyModel2', 'm1.id = m2.id_m1', 'm2') ...
This query should be run on multiple databases. Is there a way to do this? There is an equivalent function to setConnectionService?