You are here

public function ViewsRevisionsConverter::__construct in Config Entity Revisions 8

Same name in this branch
  1. 8 modules/views_revisions/src/ParamConverter/ViewsRevisionsConverter.php \Drupal\views_revisions\ParamConverter\ViewsRevisionsConverter::__construct()
  2. 8 modules/views_revisions/src/ProxyClass/ParamConverter/ViewsRevisionsConverter.php \Drupal\views_revisions\ProxyClass\ParamConverter\ViewsRevisionsConverter::__construct()
Same name and namespace in other branches
  1. 1.x modules/views_revisions/src/ParamConverter/ViewsRevisionsConverter.php \Drupal\views_revisions\ParamConverter\ViewsRevisionsConverter::__construct()

Constructs a new ViewUIConverter.

Parameters

\Drupal\Core\Entity\entityTypeManagerInterface $entity_manager: The entity manager.

\Drupal\Core\TempStore\SharedTempStoreFactory $temp_store_factory: The factory for the temp store object.

Overrides AdminPathConfigEntityConverter::__construct

File

modules/views_revisions/src/ParamConverter/ViewsRevisionsConverter.php, line 59

Class

ViewsRevisionsConverter
Provides upcasting for a view entity to be used in the Views UI, with revisions support.

Namespace

Drupal\views_revisions\ParamConverter

Code

public function __construct(EntityTypeManagerInterface $entity_manager, SharedTempStoreFactory $temp_store_factory, ConfigFactoryInterface $config_factory = NULL, AdminContext $admin_context = NULL, EntityRepositoryInterface $entityRepository = NULL) {

  // The config factory and admin context are new arguments due to changing
  // the parent. Avoid an error on updated sites by falling back to getting
  // them from the container.
  // @todo Remove in 8.2.x in https://www.drupal.org/node/2674328.
  if (!$config_factory) {
    $config_factory = \Drupal::configFactory();
  }
  if (!$admin_context) {
    $admin_context = \Drupal::service('router.admin_context');
  }
  parent::__construct($entity_manager, $config_factory, $admin_context, $entityRepository);
  $this->tempStoreFactory = $temp_store_factory;
}