You are here

public function DefaultMediaSelectionProcessor::process in Gutenberg 8

Same name and namespace in other branches
  1. 8.2 src/MediaSelectionProcessor/DefaultMediaSelectionProcessor.php \Drupal\gutenberg\MediaSelectionProcessor\DefaultMediaSelectionProcessor::process()

Process data and get array of created media entities.

Parameters

array $data: Array of data to process.

Return value

\Drupal\media\MediaInterface[] The list of media entities.

Overrides MediaSelectionProcessorInterface::process

File

src/MediaSelectionProcessor/DefaultMediaSelectionProcessor.php, line 34

Class

DefaultMediaSelectionProcessor
Handles default processing for media library selection.

Namespace

Drupal\gutenberg\MediaSelectionProcessor

Code

public function process(array $data) {
  return $this->entityTypeManager
    ->getStorage('media')
    ->loadMultiple($data);
}