You are here

public function EntityReferenceLayoutRevisioned::storageSettingsForm in Entity Reference with Layout 8

Only support references to paragraphs.

@todo Expand support to other entity types.

Overrides EntityReferenceRevisionsItem::storageSettingsForm

File

src/Plugin/Field/FieldType/EntityReferenceLayoutRevisioned.php, line 229

Class

EntityReferenceLayoutRevisioned
Entity Reference Layout Revisioned field type.

Namespace

Drupal\entity_reference_layout\Plugin\Field\FieldType

Code

public function storageSettingsForm(array &$form, FormStateInterface $form_state, $has_data) {
  $element = parent::storageSettingsForm($form, $form_state, $has_data);
  foreach ($element['target_type']['#options'] as $key => $value) {
    if ($key !== 'paragraph') {
      unset($element['target_type']['#options'][$key]);
    }
  }
  return $element;
}