Relations Upgrade From Yii 1.1

Hello, i have an application on Yii 1.1 that stores the relations inside a file ( metadata). My main model loads the relations in the constructor and when i need to create a new relation, i just add the configuration on the metadata file. All the other models extend the main model.

Since Yii 2 doesn’t use the relations function anymore, what can i do to avoid the creation of the getters for the relations on all my models and continue to have the relations defined on the metadata file ?


Can i use the magic method __call to define the relations ?

to have relations declared in a seperate file you might consider using php traits and put the relation getters in a trait.