custom/plugins/GbmedConfigStates/src/Subscriber/AccountOrderPage.php line 36

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. /**
  3.  * gb media
  4.  * All Rights Reserved.
  5.  *
  6.  * Unauthorized copying of this file, via any medium is strictly prohibited.
  7.  * The content of this file is proprietary and confidential.
  8.  *
  9.  * @category       Shopware
  10.  * @package        Shopware_Plugins
  11.  * @subpackage     GbmedConfigStates
  12.  * @copyright      Copyright (c) 2020, gb media
  13.  * @license        proprietary
  14.  * @author         Giuseppe Bottino
  15.  * @link           http://www.gb-media.biz
  16.  */
  17. namespace Gbmed\ConfigStates\Subscriber;
  18. use Shopware\Core\Content\ImportExport\Event\ImportExportBeforeImportRecordEvent;
  19. use Shopware\Storefront\Event\RouteRequest\OrderRouteRequestEvent;
  20. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  21. class AccountOrderPage implements EventSubscriberInterface
  22. {
  23.     public static function getSubscribedEvents(): array
  24.     {
  25.         return [
  26.             OrderRouteRequestEvent::class => 'onOrderRouteRequest'
  27.         ];
  28.     }
  29.     /**
  30.      * @param OrderRouteRequestEvent $event
  31.      */
  32.     public function onOrderRouteRequest(OrderRouteRequestEvent $event): void
  33.     {
  34.         $criteria $event->getCriteria();
  35.         $criteria->addAssociation('stateMachineState.gbmedConfigStates');
  36.         $criteria->getAssociation('deliveries')
  37.             ->addAssociation('stateMachineState.gbmedConfigStates');
  38.         $criteria->getAssociation('transactions')
  39.             ->addAssociation('stateMachineState.gbmedConfigStates');
  40.     }
  41. }