function ForumForm::buildEntity

Same name in other branches
  1. 8.9.x core/modules/forum/src/Form/ForumForm.php \Drupal\forum\Form\ForumForm::buildEntity()
  2. 10 core/modules/forum/src/Form/ForumForm.php \Drupal\forum\Form\ForumForm::buildEntity()
  3. 11.x core/modules/forum/src/Form/ForumForm.php \Drupal\forum\Form\ForumForm::buildEntity()

Overrides TermForm::buildEntity

1 call to ForumForm::buildEntity()
ContainerForm::buildEntity in core/modules/forum/src/Form/ContainerForm.php
Builds an updated entity object based upon the submitted form values.
1 method overrides ForumForm::buildEntity()
ContainerForm::buildEntity in core/modules/forum/src/Form/ContainerForm.php
Builds an updated entity object based upon the submitted form values.

File

core/modules/forum/src/Form/ForumForm.php, line 63

Class

ForumForm
Base form for forum term edit forms.

Namespace

Drupal\forum\Form

Code

public function buildEntity(array $form, FormStateInterface $form_state) {
    $term = parent::buildEntity($form, $form_state);
    // Assign parents from forum parent select field.
    $term->parent = [
        $form_state->getValue([
            'parent',
            0,
        ]),
    ];
    return $term;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.