You are here

public function EventTemplate::bsonUnserialize in MongoDB 8.2

1 call to EventTemplate::bsonUnserialize()
EventTemplate::__construct in modules/mongodb_watchdog/src/EventTemplate.php
EventTemplate constructor.

File

modules/mongodb_watchdog/src/EventTemplate.php, line 122

Class

EventTemplate
Class EventTemplate models an event template.

Namespace

Drupal\mongodb_watchdog

Code

public function bsonUnserialize(array $data) : void {
  foreach (static::keys() as $key => $info) {
    $datum = $data[$key] ?? NULL;
    $this->{$key} = isset($info['creation_callback']) ? $info['creation_callback']($datum) : $datum;
  }
  if (!is_string($this->message)) {
    $this->message = print_r($this->message, TRUE);
  }
}