function OEmbedWidget::singleElementObject

Overrides StringTextfieldWidget::singleElementObject

File

core/modules/media/src/Plugin/Field/FieldWidget/OEmbedWidget.php, line 33

Class

OEmbedWidget
Plugin implementation of the 'oembed_textfield' widget.

Namespace

Drupal\media\Plugin\Field\FieldWidget

Code

public function singleElementObject(FieldItemListInterface $items, $delta, Widget $widget, ElementInterface $form, FormStateInterface $form_state) : ElementInterface {
  $widget = parent::singleElementObject($items, $delta, $widget, $form, $form_state);
  $value = $widget->getChild('value');
  $value->description = $this->getValueDescription($items, $value->description);
  return $widget;
}

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