class DefaultMediaSelectionProcessor in Gutenberg 8
Same name and namespace in other branches
- 8.2 src/MediaSelectionProcessor/DefaultMediaSelectionProcessor.php \Drupal\gutenberg\MediaSelectionProcessor\DefaultMediaSelectionProcessor
Handles default processing for media library selection.
@package Drupal\gutenberg\MediaSelectionProcessor
Hierarchy
- class \Drupal\gutenberg\MediaSelectionProcessor\DefaultMediaSelectionProcessor implements MediaSelectionProcessorInterface
Expanded class hierarchy of DefaultMediaSelectionProcessor
1 string reference to 'DefaultMediaSelectionProcessor'
1 service uses DefaultMediaSelectionProcessor
File
- src/
MediaSelectionProcessor/ DefaultMediaSelectionProcessor.php, line 12
Namespace
Drupal\gutenberg\MediaSelectionProcessorView source
class DefaultMediaSelectionProcessor implements MediaSelectionProcessorInterface {
/**
* Entity type manager instance.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* DefaultMediaSelectionProcessor constructor.
*
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
*/
public function __construct(EntityTypeManagerInterface $entity_type_manager) {
$this->entityTypeManager = $entity_type_manager;
}
/**
* {@inheritDoc}
*/
public function process(array $data) {
return $this->entityTypeManager
->getStorage('media')
->loadMultiple($data);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DefaultMediaSelectionProcessor:: |
protected | property | Entity type manager instance. | |
DefaultMediaSelectionProcessor:: |
public | function |
Process data and get array of created media entities. Overrides MediaSelectionProcessorInterface:: |
|
DefaultMediaSelectionProcessor:: |
public | function | DefaultMediaSelectionProcessor constructor. |