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

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