You are here

public function MediaSubFormManager::getFields in Media Bulk Upload 8

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

Overrides MediaSubFormManagerInterface::getFields

1 call to MediaSubFormManager::getFields()
MediaSubFormManager::buildMediaSubForm in src/MediaSubFormManager.php

File

src/MediaSubFormManager.php, line 201

Class

MediaSubFormManager
Class MediaSubFormManager.

Namespace

Drupal\media_bulk_upload

Code

public function getFields(MediaBulkConfigInterface $mediaBulkConfig) {
  $mediaTypes = $this->mediaTypeManager
    ->getBulkMediaTypes($mediaBulkConfig);
  $fields = $this
    ->getMediaEntityFieldComponents($mediaBulkConfig, array_shift($mediaTypes));
  foreach ($mediaTypes as $mediaType) {
    $fields = array_intersect($fields, $this
      ->getMediaEntityFieldComponents($mediaBulkConfig, $mediaType));
  }
  return $fields;
}