_refreshMany2Many(relations) {
        const ThisModel = this.getClass();
        const { fields, virtualFields, modelName } = ThisModel;

        Object.keys(relations).forEach((name) => {
            const reverse = !fields.hasOwnProperty(name);
            const field = virtualFields[name];
            const values = relations[name];

            if (!Array.isArray(values)) {
                throw new TypeError(
                    `Failed to resolve many-to-many relationship: ${modelName}[${name}] must be an array (passed: ${values})`
                );
            }

            const normalizedNewIds = values.map(normalizeEntity);
            const uniqueIds = [...new Set(normalizedNewIds)];

            if (normalizedNewIds.length !== uniqueIds.length) {
                throw new Error(
                    `Found duplicate id(s) when passing "${normalizedNewIds}" to ${ThisModel.modelName}.${name} value`
                );
            }

            const throughModelName =
                field.through || m2mName(ThisModel.modelName, name);
            const ThroughModel = ThisModel.session[throughModelName];

            let fromField;
            let toField;

            if (!reverse) {
                ({ from: fromField, to: toField } = field.throughFields);
            } else {
                ({ from: toField, to: fromField } = field.throughFields);
            }

            const currentIds = ThroughModel.filter(
                (through) => through[fromField] === this[ThisModel.idAttribute]
            )
                .toRefArray()
                .map((ref) => ref[toField]);

            const diffActions = arrayDiffActions(currentIds, normalizedNewIds);

            if (diffActions) {
                const { delete: idsToDelete, add: idsToAdd } = diffActions;
                if (idsToDelete.length > 0) {
                    this[field.as || name].remove(...idsToDelete);
                }

                if (idsToAdd.length > 0) {
                    this[field.as || name].add(...idsToAdd);
                }
            }
        });
    }
Update many-many relations for model.
@param relations
@return undefined
@private