custom/plugins/NetzpShopmanager6/src/Controller/StatisticsController.php line 36

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace NetzpShopmanager6\Controller;
  3. use Shopware\Core\Framework\Routing\Annotation\RouteScope;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. use NetzpShopmanager6\Components\ShopmanagerVisitors;
  6. use Shopware\Core\System\SystemConfig\SystemConfigService;
  7. use Symfony\Component\DependencyInjection\ContainerInterface;
  8. use Symfony\Component\HttpFoundation\Request;
  9. use Symfony\Component\HttpFoundation\Response;
  10. use Shopware\Core\System\SalesChannel\SalesChannelContext;
  11. use Shopware\Storefront\Controller\StorefrontController;
  12. /**
  13.  * @RouteScope(scopes={"storefront"})
  14.  */
  15. class StatisticsController extends StorefrontController
  16. {
  17.     protected $container;
  18.     protected $config;
  19.     private $visitors;
  20.     public function __construct(ContainerInterface $data,
  21.         SystemConfigService $systemConfigService,
  22.         ShopmanagerVisitors $visitors)
  23.     {
  24.         $this->container $data;
  25.         $this->config $systemConfigService;
  26.         $this->visitors  $visitors;
  27.     }
  28.     /**
  29.      * @Route("/store-api/netzp/shopmanager/statistics", name="store-api.netzp.shopmanager.statistics", defaults={"XmlHttpRequest"=true}, options={"seo"="false"}, methods={"GET"})
  30.      */
  31.     public function countStatistics(SalesChannelContext $contextRequest $request)
  32.     {
  33.         $this->visitors->logStats($context->getContext(), $context->getSalesChannel()->getId(), $request);
  34.         return new Response();
  35.     }
  36. }