I am trying to create custom query in the hasMany function. I am not getting any error, but I am not getting any data from the table inside join statement. What’s is wrong?
This should work as expected, and there’s no performance drawback in it.
[EDIT]
The query you have defined for the relation should work as expected, but Yii will not use ‘licences.licenceName’ to populate the related ‘UserKeys’ model.