Almost in every project we have many-to-many ralations.
For example:
author
--------------
id
name
book
--------------
id
title
author_to_book
--------------
id
author_id
book_id
I want to work with such a structure such a way:
$author = Author::findOne($id);
$author.bookIds = [12, 33];
$author.save();
I have found many "Many-to-Mamy Behavior" extensions on github. One of them: https://github.com/yii2tech/ar-linkmany (from yii2 core team guy). But what is the best modern solution for it?
Is there a core yii2 solution without external extensions?
Maybe I should use link() for it?