class MediaPdfThumbnailGeneratorBase in Media PDF Thumbnail 8.4
Class MediaPdfThumbnailGeneratorBase
@package Drupal\media_pdf_thumbnail\Plugin\QueueWorker
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Queue\QueueWorkerBase implements QueueWorkerInterface
- class \Drupal\media_pdf_thumbnail\Plugin\QueueWorker\MediaPdfThumbnailGeneratorBase implements ContainerFactoryPluginInterface
- class \Drupal\Core\Queue\QueueWorkerBase implements QueueWorkerInterface
Expanded class hierarchy of MediaPdfThumbnailGeneratorBase
File
- src/
Plugin/ QueueWorker/ MediaPdfThumbnailGeneratorBase.php, line 16
Namespace
Drupal\media_pdf_thumbnail\Plugin\QueueWorkerView source
class MediaPdfThumbnailGeneratorBase extends QueueWorkerBase implements ContainerFactoryPluginInterface {
/**
* @var \Drupal\media_pdf_thumbnail\Manager\MediaPdfThumbnailImageManager
*/
protected $mediaPdfThumbnailImageManager;
/**
* MediaThumbnailGeneratorBase constructor.
*
* @param \Drupal\media_pdf_thumbnail\Manager\MediaPdfThumbnailImageManager $mediaPdfThumbnailImageManager
*/
public function __construct(MediaPdfThumbnailImageManager $mediaPdfThumbnailImageManager) {
$this->mediaPdfThumbnailImageManager = $mediaPdfThumbnailImageManager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($container
->get('media_pdf_thumbnail.image.manager'));
}
/**
* @param mixed $data
*
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
* @throws \Drupal\Core\Entity\EntityStorageException
* @throws \Drupal\Core\TypedData\Exception\MissingDataException
*/
public function processItem($data) {
if ($data->media instanceof MediaInterface && !empty($data->field) && !empty($data->thumbnailType)) {
$this->mediaPdfThumbnailImageManager
->createThumbnail($data->media, $data->field, $data->thumbnailType);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MediaPdfThumbnailGeneratorBase:: |
protected | property | ||
MediaPdfThumbnailGeneratorBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
MediaPdfThumbnailGeneratorBase:: |
public | function |
Overrides QueueWorkerInterface:: |
|
MediaPdfThumbnailGeneratorBase:: |
public | function |
MediaThumbnailGeneratorBase constructor. Overrides PluginBase:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. |