Implementing BelongsToMany::replaceLinks