You are here

public function BricksTreeDynamicInlineWidget::rebuild in Bricks​ 8

Same name and namespace in other branches
  1. 2.x modules/bricks_dynamic/src/Plugin/Field/FieldWidget/BricksTreeDynamicInlineWidget.php \Drupal\bricks_dynamic\Plugin\Field\FieldWidget\BricksTreeDynamicInlineWidget::rebuild()

File

modules/bricks_dynamic/src/Plugin/Field/FieldWidget/BricksTreeDynamicInlineWidget.php, line 206

Class

BricksTreeDynamicInlineWidget
Plugin annotation @FieldWidget( id = "bricks_tree_dynamic_inline", label = @Translation("Bricks tree Dynamic (Inline entity form)"), description = @Translation("A tree of inline entity forms."), field_types = { "bricks_dynamic" }, …

Namespace

Drupal\bricks_dynamic\Plugin\Field\FieldWidget

Code

public function rebuild(array &$form, FormStateInterface $form_state) {
  $parents = $form_state
    ->getTriggeringElement()['#parents'];
  array_pop($parents);
  array_pop($parents);
  $fieldset = NestedArray::getValue($form, $parents);
  return $fieldset;
}