You are here

function recipe_form_node_type_form_builder in Recipe 8.2

Entity builder for the node type form with menu options.

See also

recipe_form_node_type_form_alter()

1 string reference to 'recipe_form_node_type_form_builder'
recipe_form_node_type_edit_form_alter in ./recipe.module
Implements hook_form_BASE_FORM_ID_alter() for 'node_type_edit_form'.

File

./recipe.module, line 126
Contains functions for Recipe node CRUD and display.

Code

function recipe_form_node_type_form_builder($entity_type, NodeTypeInterface $type, &$form, FormStateInterface $form_state) {
  $type
    ->setThirdPartySetting('recipe', 'total_time_label', $form_state
    ->getValue('recipe_total_time_label'));
  $type
    ->setThirdPartySetting('recipe', 'total_time_label_display', $form_state
    ->getValue('recipe_total_time_label_display'));
  $type
    ->setThirdPartySetting('recipe', 'yield_label', $form_state
    ->getValue('recipe_yield_label'));
  $type
    ->setThirdPartySetting('recipe', 'yield_label_display', $form_state
    ->getValue('recipe_yield_label_display'));

  // Invalidate the node cache so the changes will appear in node displays.
  Cache::invalidateTags([
    'node_view',
  ]);
}