protected function MediaSourceBase::createSourceFieldStorage in Drupal 9
Same name and namespace in other branches
- 8 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.
2 calls to MediaSourceBase::createSourceFieldStorage()
- MediaSourceBase::createSourceField in core/
modules/ media/ src/ MediaSourceBase.php - Creates the source field definition for a type.
- MediaSourceBase::submitConfigurationForm in core/
modules/ media/ src/ MediaSourceBase.php - Form submission handler.
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']),
]);
}