You are here

public function ViewsEntitySchemaSubscriber::__construct in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/EventSubscriber/ViewsEntitySchemaSubscriber.php \Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber::__construct()

Constructs a ViewsEntitySchemaSubscriber.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Psr\Log\LoggerInterface $logger: A logger instance.

File

core/modules/views/src/EventSubscriber/ViewsEntitySchemaSubscriber.php, line 101

Class

ViewsEntitySchemaSubscriber
Reacts to changes on entity types to update all views entities.

Namespace

Drupal\views\EventSubscriber

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, LoggerInterface $logger = NULL) {
  $this->entityTypeManager = $entity_type_manager;
  if (!$logger) {
    @trigger_error('Calling ViewsEntitySchemaSubscriber::__construct() with the $logger argument is supported in drupal:8.7.1 and will be required before drupal:9.0.0. See https://www.drupal.org/project/drupal/issues/3052492.', E_USER_DEPRECATED);
    $logger = \Drupal::service('logger.channel.default');
  }
  $this->logger = $logger;
}