public static function addManyManyRelationshipFields(
        FieldList &$fields,
        $relationship,
        $overrideFieldClass,
        $tabbed,
        DataObject $dataObject
    ) {
        if ($tabbed) {
            $fields->findOrMakeTab(
                "Root.$relationship",
                $dataObject->fieldLabel($relationship)
            );
        }

        $fieldClass = $overrideFieldClass ?: GridField::class;

        /** @var GridField $grid */
        $grid = Injector::inst()->create(
            $fieldClass,
            $relationship,
            $dataObject->fieldLabel($relationship),
            $dataObject->$relationship(),
            GridFieldConfig_RelationEditor::create()
        );

        if ($tabbed) {
            $fields->addFieldToTab("Root.$relationship", $grid);
        } else {
            $fields->push($grid);
        }
    }