You are here

public function DigestBase::__wakeup in Message Digest 8

Implements the magic __wakeup() method.

File

src/Plugin/Notifier/DigestBase.php, line 264

Class

DigestBase
Message Digest notifier.

Namespace

Drupal\message_digest\Plugin\Notifier

Code

public function __wakeup() {

  // Restore the database connection.
  $this->connection = Database::getConnection();

  // Restore the dependencies from the container.
  $container = \Drupal::getContainer();
  $this->entityTypeManager = $container
    ->get('entity_type.manager');
  $this->logger = $container
    ->get('logger.channel.message_notify');
  $this->renderer = $container
    ->get('renderer');
  $this->state = $container
    ->get('state');
  $this->time = $container
    ->get('datetime.time');
}