Commit a2132397 authored by GiorgosK's avatar GiorgosK

Injecting Logger in controller

parent 5bfe1909
......@@ -7,7 +7,7 @@ use Drupal\Core\Entity\EntityTypeManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
use Drupal\commerce_order\Entity\Order;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
/**
* Endpoints for the routes defined.
*/
......@@ -20,8 +20,9 @@ class CallbackController extends ControllerBase {
/**
*
*/
public function __construct(EntityTypeManagerInterface $entityTypeManager) {
public function __construct(EntityTypeManagerInterface $entityTypeManager, LoggerChannelFactoryInterface $logger_factory) {
$this->entityTypeManager = $entityTypeManager;
$this->logger = $logger_factory->get('commerce_winbank_redirect');
}
/**
......@@ -29,7 +30,8 @@ class CallbackController extends ControllerBase {
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('entity_type.manager')
$container->get('entity_type.manager'),
$container->get('logger.factory')
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment