public function SVG::createSourceField in SVG Image Field 8
Same name and namespace in other branches
- 2.1.x src/Plugin/media/Source/SVG.php \Drupal\svg_image_field\Plugin\media\Source\SVG::createSourceField()
- 2.0.x src/Plugin/media/Source/SVG.php \Drupal\svg_image_field\Plugin\media\Source\SVG::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 File::createSourceField
File
- src/
Plugin/ media/ Source/ SVG.php, line 24
Class
- SVG
- Provides media type plugin for SVG image field.
Namespace
Drupal\svg_image_field\Plugin\media\SourceCode
public function createSourceField(MediaTypeInterface $type) {
return parent::createSourceField($type)
->set('settings', [
'file_extensions' => 'svg',
]);
}