Skip to content
Snippets Groups Projects
Select Git revision
  • 6451917bf366b6a944d31c97066333e070ee1d9c
  • main default protected
  • register-logging-channel
  • expr-lang
  • ci-82
  • attr-events
  • locale-wip
  • custom-routes
  • v0.1.85
  • v0.1.84
  • v0.1.83
  • v0.1.82
  • v0.1.81
  • v0.1.80
  • v0.1.79
  • v0.1.78
  • v0.1.77
  • v0.1.76
  • v0.1.75
  • v0.1.74
  • v0.1.73
  • v0.1.72
  • v0.1.71
  • v0.1.70
  • v0.1.69
  • v0.1.68
  • v0.1.67
  • v0.1.65
28 results

ProxyDataEvent.php

  • user avatar
    Tobias Gross-Vogt authored
    6451917b
    History
    ProxyDataEvent.php 1.06 KiB
    <?php
    
    declare(strict_types=1);
    
    namespace Dbp\Relay\CoreBundle\ProxyApi;
    
    use Symfony\Contracts\EventDispatcher\Event;
    
    class ProxyDataEvent extends Event
    {
        public const NAME = 'dbp.relay.core_bundle.proxy_data';
    
        /** @var ProxyDataInterface */
        private $proxyData;
    
        /** @var bool */
        private $wasAcknowledged;
    
        public function __construct(ProxyDataInterface $proxyData)
        {
            $this->proxyData = $proxyData;
            $this->wasAcknowledged = false;
        }
    
        public function getProxyData(): ProxyDataInterface
        {
            return $this->proxyData;
        }
    
        /**
         * Acknowledge the event, i.e. tell that there was an event subscriber responsible for the requested proxy data namespace.
         */
        public function acknowledge(): void
        {
            $this->wasAcknowledged = true;
        }
    
        /**
         * True, if the event was acknowledged, e.g. there was an event subscriber responsible for the requested proxy data namespace, false otherwise.
         */
        public function wasAcknowledged(): bool
        {
            return $this->wasAcknowledged;
        }
    }