vendor/shopware/core/Framework/Event/BusinessEvent.php line 57

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Framework\Event;
  3. use Shopware\Core\Framework\Context;
  4. use Shopware\Core\Framework\Event\EventData\EventDataCollection;
  5. use Shopware\Core\Framework\Feature;
  6. use Symfony\Contracts\EventDispatcher\Event;
  7. /**
  8.  * @deprecated tag:v6.5.0 - Will be removed in v6.5.0.
  9.  */
  10. class BusinessEvent extends Event implements BusinessEventInterface
  11. {
  12.     /**
  13.      * @var BusinessEventInterface
  14.      */
  15.     private $event;
  16.     /**
  17.      * @var array
  18.      */
  19.     private $config;
  20.     /**
  21.      * @var string
  22.      */
  23.     private $actionName;
  24.     public function __construct(string $actionNameBusinessEventInterface $event, ?array $config = [])
  25.     {
  26.         $this->actionName $actionName;
  27.         $this->event $event;
  28.         $this->config $config ?? [];
  29.     }
  30.     public function getEvent(): BusinessEventInterface
  31.     {
  32.         Feature::triggerDeprecationOrThrow(
  33.             'v6.5.0.0',
  34.             Feature::deprecatedClassMessage(__CLASS__'v6.5.0.0''FlowEvent')
  35.         );
  36.         return $this->event;
  37.     }
  38.     public function getConfig(): array
  39.     {
  40.         Feature::triggerDeprecationOrThrow(
  41.             'v6.5.0.0',
  42.             Feature::deprecatedClassMessage(__CLASS__'v6.5.0.0''FlowEvent')
  43.         );
  44.         return $this->config;
  45.     }
  46.     public function getActionName(): string
  47.     {
  48.         Feature::triggerDeprecationOrThrow(
  49.             'v6.5.0.0',
  50.             Feature::deprecatedClassMessage(__CLASS__'v6.5.0.0''FlowEvent')
  51.         );
  52.         return $this->actionName;
  53.     }
  54.     public static function getAvailableData(): EventDataCollection
  55.     {
  56.         Feature::triggerDeprecationOrThrow(
  57.             'v6.5.0.0',
  58.             Feature::deprecatedClassMessage(__CLASS__'v6.5.0.0''FlowEvent')
  59.         );
  60.         return new EventDataCollection();
  61.     }
  62.     public function getName(): string
  63.     {
  64.         Feature::triggerDeprecationOrThrow(
  65.             'v6.5.0.0',
  66.             Feature::deprecatedClassMessage(__CLASS__'v6.5.0.0''FlowEvent')
  67.         );
  68.         return $this->event->getName();
  69.     }
  70.     public function getContext(): Context
  71.     {
  72.         Feature::triggerDeprecationOrThrow(
  73.             'v6.5.0.0',
  74.             Feature::deprecatedClassMessage(__CLASS__'v6.5.0.0''FlowEvent')
  75.         );
  76.         return $this->event->getContext();
  77.     }
  78. }