/** * {@inheritdoc} */ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); if ($this->targetEntityType->hasKey('bundle')) { $options = []; foreach ($this->entityTypeBundleInfo->getBundleInfo($this->targetEntityType->id()) as $bundle_id => $bundle_info) { $options[$bundle_id] = $bundle_info['label']; } $form['verf_target_bundles'] = [ '#type' => 'checkboxes', '#title' => $this->t('Target entity bundles to filter by'), '#options' => $options, '#default_value' => array_filter($this->options['verf_target_bundles']), ]; } return $form; }
/** * {@inheritdoc} */ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $subform = []; $subform_state = new ViewsHandlerFormState($form_state); $entity_reference_selection_selector = $this->getPluginSelector($form_state); $form['entity_reference_selection'] = $entity_reference_selection_selector->buildSelectorForm($subform, $subform_state); return $form; }