public function OEmbed::createSourceField in Drupal 9
Same name and namespace in other branches
- 8 core/modules/media/src/Plugin/media/Source/OEmbed.php \Drupal\media\Plugin\media\Source\OEmbed::createSourceField()
Creates the source field definition for a type.
Parameters
\Drupal\media\MediaTypeInterface $type: The media type.
Return value
\Drupal\field\FieldConfigInterface The unsaved field definition. The field storage definition, if new, should also be unsaved.
Overrides MediaSourceBase::createSourceField
File
- core/
modules/ media/ src/ Plugin/ media/ Source/ OEmbed.php, line 525
Class
- OEmbed
- Provides a media source plugin for oEmbed resources.
Namespace
Drupal\media\Plugin\media\SourceCode
public function createSourceField(MediaTypeInterface $type) {
$plugin_definition = $this
->getPluginDefinition();
$label = (string) $this
->t('@type URL', [
'@type' => $plugin_definition['label'],
]);
return parent::createSourceField($type)
->set('label', $label);
}