You are here

public function OptionsBase::getRelatedTypes in YAML Form 8

Get related element types.

Parameters

array $element: The element.

Return value

array An array containing related element types.

Overrides YamlFormElementBase::getRelatedTypes

File

src/Plugin/YamlFormElement/OptionsBase.php, line 81

Class

OptionsBase
Provides a base 'options' element.

Namespace

Drupal\yamlform\Plugin\YamlFormElement

Code

public function getRelatedTypes(array $element) {
  $related_types = parent::getRelatedTypes($element);

  // Remove entity reference elements.
  $elements = $this->elementManager
    ->getInstances();
  foreach ($related_types as $type => $related_type) {
    $element_instance = $elements[$type];
    if ($element_instance instanceof YamlFormEntityReferenceInterface) {
      unset($related_types[$type]);
    }
  }
  return $related_types;
}