| @@ 144-155 (lines=12) @@ | ||
| 141 | * @return static |
|
| 142 | * The database instance. |
|
| 143 | */ |
|
| 144 | public static function create(ContainerInterface $container) { |
|
| 145 | /** @var \MongoDB $database */ |
|
| 146 | $database = $container->get('mongodb.watchdog_storage'); |
|
| 147 | ||
| 148 | /** @var \Psr\Log\LoggerInterface $logger */ |
|
| 149 | $logger = $container->get('logger.channel.mongodb_watchdog'); |
|
| 150 | ||
| 151 | /** @var \Drupal\mongodb_watchdog\Logger $logger */ |
|
| 152 | $watchdog = $container->get('mongodb.logger'); |
|
| 153 | ||
| 154 | return new static($database, $logger, $watchdog); |
|
| 155 | } |
|
| 156 | } |
|
| 157 | ||
| @@ 224-234 (lines=11) @@ | ||
| 221 | /** |
|
| 222 | * {@inheritdoc} |
|
| 223 | */ |
|
| 224 | public static function create(ContainerInterface $container) { |
|
| 225 | /** @var \Psr\Log\LoggerInterface $logger */ |
|
| 226 | $logger = $container->get('logger.factory')->get('mongodb_watchdog'); |
|
| 227 | ||
| 228 | /** @var \Drupal\mongodb_watchdog\Logger $watchdog */ |
|
| 229 | $watchdog = $container->get('mongodb.logger'); |
|
| 230 | ||
| 231 | /** @var \MongoDB\Database $db */ |
|
| 232 | $db = $container->get('mongodb.watchdog_storage'); |
|
| 233 | return new static($logger, $watchdog, $db); |
|
| 234 | } |
|
| 235 | ||
| 236 | } |
|
| 237 | ||