You are here

public function HierarchyTreeSummary::buildOptionsForm in Entity Reference Hierarchy 3.x

Default options form that provides the label widget that all fields should have.

Overrides FieldPluginBase::buildOptionsForm

File

src/Plugin/views/field/HierarchyTreeSummary.php, line 84

Class

HierarchyTreeSummary
A handler to provide a field that show hierarchy depth of item.

Namespace

Drupal\entity_hierarchy\Plugin\views\field

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  $form['summary_type'] = [
    '#type' => 'select',
    '#required' => TRUE,
    '#options' => [
      'child_counts' => 'Number of children at each level below',
    ],
    '#title' => $this
      ->t('Summary type'),
    '#default_value' => $this->options['summary_type'],
    '#description' => $this
      ->t('Choose the summary type.'),
  ];
  parent::buildOptionsForm($form, $form_state);
}