Sets the allowed Paragraphs types that can be added.
string $content_type: Content type name that contains the paragraphs field.
array $paragraphs_types: Array of paragraphs types that will be modified.
bool $selected: Whether or not the paragraphs types will be enabled.
string $paragraphs_field: Paragraphs field name that does the reference.
protected function setAllowedParagraphsTypes($content_type, $paragraphs_types, $selected, $paragraphs_field) {
$edit = [];
$this
->drupalGet('admin/structure/types/manage/' . $content_type . '/fields/node.' . $content_type . '.' . $paragraphs_field);
foreach ($paragraphs_types as $paragraphs_type) {
$edit['settings[handler_settings][target_bundles_drag_drop][' . $paragraphs_type . '][enabled]'] = $selected;
}
$this
->submitForm($edit, 'Save settings');
}