ActiveRecord toArray() and lazy loading

Hi guys.

I want to serialize array of AR objects with all of its relations, using fileds() and extraFields() properties.

Something like this:




public function actionIndex()

{

    $list = Model::find()->with(['rel1', 'rel2])->all();

    return $list;

}



How should I describe many-to-many relations in extraFields(), in order to avoid lazy loading?