You are here

public static function ContentHubExportQueueBase::create in Acquia Content Hub 8

Creates an instance of the plugin.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The container to pull out services used in the plugin.

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin ID for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

Return value

static Returns an instance of this plugin.

Overrides ContainerFactoryPluginInterface::create

File

src/Plugin/QueueWorker/ContentHubExportQueueBase.php, line 82

Class

ContentHubExportQueueBase
Provides base functionality for the Content Hub Export Queue.

Namespace

Drupal\acquia_contenthub\Plugin\QueueWorker

Code

public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {

  /** @var \Drupal\acquia_contenthub\EntityManager $entity_manager */
  $entity_manager = $container
    ->get('acquia_contenthub.entity_manager');

  /** @var \Drupal\acquia_contenthub\Controller\ContentHubEntityExportController $acquia_contenthub_export_controller */
  $acquia_contenthub_export_controller = $container
    ->get('acquia_contenthub.acquia_contenthub_export_entities');

  /** @var \Drupal\acquia_contenthub\Controller\ContentHubExportQueueController $export_queue_controller */
  $export_queue_controller = $container
    ->get('acquia_contenthub.acquia_contenthub_export_queue');

  /** @var \Drupal\acquia_contenthub\Normalizer\ContentEntityCdfNormalizer $cdf_normalizer */
  $cdf_normalizer = \Drupal::service('acquia_contenthub.normalizer.entity.acquia_contenthub_cdf');

  /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager */
  $entity_type_manager = $container
    ->get('entity_type.manager');

  /** @var \Drupal\Core\Logger\LoggerChannelFactoryInterface $logger_channel_factory */
  $logger_channel_factory = $container
    ->get('logger.factory');
  return new static($entity_manager, $acquia_contenthub_export_controller, $export_queue_controller, $cdf_normalizer, $entity_type_manager, $logger_channel_factory);
}