protected function MediaSourceBase::createSourceFieldStorage in Drupal 10
Same name and namespace in other branches
- 8 core/modules/media/src/MediaSourceBase.php \Drupal\media\MediaSourceBase::createSourceFieldStorage()
- 9 core/modules/media/src/MediaSourceBase.php \Drupal\media\MediaSourceBase::createSourceFieldStorage()
Creates the source field storage definition.
By default, the first field type listed in the plugin definition's allowed_field_types array will be the generated field's type.
Return value
\Drupal\field\FieldStorageConfigInterface The unsaved field storage definition.
File
- core/
modules/ media/ src/ MediaSourceBase.php, line 238
Class
- MediaSourceBase
- Base implementation of media source plugin.
Namespace
Drupal\mediaCode
protected function createSourceFieldStorage() {
return $this->entityTypeManager
->getStorage('field_storage_config')
->create([
'entity_type' => 'media',
'field_name' => $this
->getSourceFieldName(),
'type' => reset($this->pluginDefinition['allowed_field_types']),
]);
}