Elo bird lovers,
I'm looking for a feature by which you can set a default namespace for PHQL. The closet thing I found is here, by which every model would have to be setup manually.
1
So when using models residing in SomeApp\Models\...
, I could write it like so:
$modelsManager->setDefaultNamespace("SomeApp\Models");
$queryString = "SELECT * FROM Robots JOIN RobotEvents WHERE RobotEvents.type=:eventType:";
$modelsManager->executeQuery($queryString, ['eventType'=>$type]);
2 I imagine accessing models in other namespaces could work with absolute paths:
$queryString = "SELECT * FROM \OtherApp\Models\Robots JOIN RobotEvents WHERE RobotEvents.type=:eventType:";
3 Additional awesomeness would be if you could still use aliases:
$queryString = "SELECT * FROM \OtherApp\Models\Robots JOIN RobotEvents re WHERE re.type=:eventType:";
Do features like these exists? Cheers!