You are here

public function MediaTypeManager::getTargetFieldSettings in Media Bulk Upload 8

Get the target field settings for the media type.

Parameters

\Drupal\media\MediaTypeInterface $mediaType: Media Type.

Return value

array The field settings.

Overrides MediaTypeManagerInterface::getTargetFieldSettings

2 calls to MediaTypeManager::getTargetFieldSettings()
MediaTypeManager::getMediaTypeExtensions in src/MediaTypeManager.php
Get the Media Type extensions.
MediaTypeManager::getTargetFieldMaxSize in src/MediaTypeManager.php
Get the target maximum upload size.

File

src/MediaTypeManager.php, line 108

Class

MediaTypeManager
Class MediaTypeManager

Namespace

Drupal\media_bulk_upload

Code

public function getTargetFieldSettings(MediaTypeInterface $mediaType) {
  $fieldDefinitions = $this->entityFieldManager
    ->getFieldDefinitions('media', $mediaType
    ->id());
  $targetFieldName = $this
    ->getTargetFieldName($mediaType);

  /** @var \Drupal\field\Entity\FieldConfig $targetField */
  $targetField = $fieldDefinitions[$targetFieldName];
  return $targetField
    ->getSettings();
}