Adds a content type with a Paragraphs field.
string $content_type_name: Content type name to be used.
string $paragraphs_field_name: (optional) Field name to be used. Defaults to 'field_paragraphs'.
string $widget_type: (optional) Declares if we use stable or legacy widget. Defaults to 'paragraphs' for stable widget. Use 'entity_reference_paragraphs' for legacy widget.
protected function addParagraphedContentType($content_type_name, $paragraphs_field_name = 'field_paragraphs', $widget_type = 'paragraphs') {
// Create the content type.
$node_type = NodeType::create([
'type' => $content_type_name,
'name' => $content_type_name,
]);
$node_type
->save();
$this
->addParagraphsField($content_type_name, $paragraphs_field_name, 'node', $widget_type);
}