I have a model class: App\Frontend\Models\Users
, when I use PHQL, the statement is too long! I
$phql = 'select u.id from App\Frontend\Models\Users as u';
Then I found a method from API Documnet:
modelsManager->registerNamespaceAlias( $alias , $namespece);
but can someone tell me how to use it? I can't find any information about it from the document!
I have tried the follow statements, all of them trigger class not found error:
$this->modelsManager->registerNamespaceAlias('ns','App\Frontend\Models');
$phql = 'select u.id from ns\Users as u';
$this->modelsManager->registerNamespaceAlias('users','App\Frontend\Models\Users');
$phql = 'select u.id from users as u';