Move independent code outside of the loop
Move independent code outside of the loop

voskobovich/yii2-many-to-many-behavior,kfreiman/ManyToManyBehavior,sunfun/ManyToManyBehavior,voskobovich/ManyToManyBehavior