You are here

function paragraphs_library_form_paragraphs_type_form_builder in Paragraphs 8

Entity builder for the paragraphs type form with group property.

See also

primer_base_form_paragraphs_type_form_alter()

1 string reference to 'paragraphs_library_form_paragraphs_type_form_builder'
paragraphs_library_form_paragraphs_type_form_alter in modules/paragraphs_library/paragraphs_library.module
Implements hook_form_FORM_ID_alter().

File

modules/paragraphs_library/paragraphs_library.module, line 216
Main module file for the Paragraphs Library module.

Code

function paragraphs_library_form_paragraphs_type_form_builder($entity_type, ParagraphsTypeInterface $type, &$form, FormStateInterface $form_state) {
  if ($form_state
    ->getValue('allow_library_conversion')) {
    $type
      ->setThirdPartySetting('paragraphs_library', 'allow_library_conversion', $form_state
      ->getValue('allow_library_conversion'));
  }
  else {
    $type
      ->unsetThirdPartySetting('paragraphs_library', 'allow_library_conversion');
  }
}