Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Image.php

function Image::createSourceField

Overrides File::createSourceField

File

core/modules/media/src/Plugin/media/Source/Image.php, line 156

Class

Image
Image entity media source.

Namespace

Drupal\media\Plugin\media\Source

Code

public function createSourceField(MediaTypeInterface $type) {
    
    /** @var \Drupal\field\FieldConfigInterface $field */
    $field = parent::createSourceField($type);
    // Reset the field to its default settings so that we don't inherit the
    // settings from the parent class' source field.
    $settings = $this->fieldTypeManager
        ->getDefaultFieldSettings($field->getType());
    return $field->set('settings', $settings);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal