Reputation: 13110
I'd like to either extend or replace yii\db\ActiveQuery
with my own class and have the entire application use it.
This is to bring in the @alias
functionality referenced by CedricYii at the bottom of this GitHub issue.
Due to the private nature of some of the changed functions, I'll probably have to replace it.
Is this possible? Or will I have to fork the repository?
Upvotes: 3
Views: 880
Reputation: 1592
Use Dependency Injection Container for this.
Write down in your application bootstrap code:
Yii::$container->set('yii\db\ActiveQuery', 'app\components\ActiveQuery');
Upvotes: 5