Adds a subscriber to this dispatcher which in its turn adds all the subscribed events.

@param SubscriberInterface $subscriber The subscriber which can subscribe to multiple events
179658
public function addSubscriber(SubscriberInterface $subscriber)
    {
        foreach ($subscriber->getSubscribedEvents() as $eventName => $callable) {
            $this->addListener($eventName, $callable);
        }
    }
648128
public function bind(Subscriber $subscriber, $eventIdentifier) {
    if ($eventIdentifier instanceof Event) {
      $eventIdentifier = $eventIdentifier->getIdentifier();
    }
    
    if (!isset($this->subscribers[$eventIdentifier]))
      $this->subscribers[$eventIdentifier] = array();
      
    $this->subscribers[$eventIdentifier][] = $subscriber;
    
    return $this;
  }
388959
public function subscribe(ChannelInterface $channel, SubscriberInterface $subscriber)
    {
        $this->subscribers[$channel->getIdentifier()][$subscriber->getIdentifier()] = $subscriber;

        return $this;
    }
400858
public function onUpdate(SubscriberEvent $event)
    {
        $this->listRepository->update(
            $event->getListId(),
            $event->getSubscriber()
        );
    }
218571
public function subscribe(Dispatcher $dispatcher)
    {
        $dispatcher->listen(Login::class, self::class.'@login');
        $dispatcher->listen(Lockout::class, self::class.'@lockout');
        $dispatcher->listen(Registered::class, self::class.'@registered');
    }
501654
public function subscribed($subscriber)
    {
        if ($subscriber->id && $this->subscriberIds->offsetExists($subscriber->id)) {
            return true;
        }

        return false;
    }
252722
public function removeSubscriber(\Enhavo\Bundle\NewsletterBundle\Entity\Subscriber $subscriber)
    {
        $this->subscriber->removeElement($subscriber);
    }
104866
public function triggerSubscriptionActivated(GatewayInterface $gateway, SubscriptionInterface $subscription)
    {
        $this->trigger(self::ON_SUBSCRIPTION_ACTIVATED, $gateway, $subscription);
    }
366827
def add_parameter_subscriber(subscriber)
      subscriber.set_manager(self)
      @parameter_subscribers.push(subscriber)
      @master.subscribe_param(subscriber.key)
      subscriber
    end
193400
public function subscribe(Dispatcher $dispatcher)
    {
        $dispatcher->listen('*.entity.created', __CLASS__.'@entityCreated');
        $dispatcher->listen('*.entity.updated', __CLASS__.'@entityUpdated');
        $dispatcher->listen('*.entity.deleted', __CLASS__.'@entityDeleted');
    }
960178
private function filterSubscribed($subscribed = null)
    {
        if ($subscribed === true) {
            $this->subscriptionCollection->addFieldToFilter('subscriber_status', ['eq' => 1]);
        } elseif ($subscribed === false) {
            $this->subscriptionCollection->addFieldToFilter('subscriber_status', ['neq' => 1]);
        }
        return $this;
    }
861833
private function doBeforeCompile(): void
	{
		$builder = $this->getContainerBuilder();
		$dispatcher = $builder->getDefinition($this->prefix('dispatcher'));

		$subscribers = $builder->findByType(EventSubscriberInterface::class);
		foreach ($subscribers as $name => $subscriber) {
			$dispatcher->addSetup('addSubscriber', [$subscriber]);
		}
	}
861549
public function broadcast(Subscriber $subscriber, array $data): void
    {
        $this->pusher->trigger(
            $subscriber->channel,
            self::EVENT_NAME,
            [
                'more' => true,
                'result' => $data,
            ]
        );
    }
1370149
public function registerEventListeners(DispatcherContract $dispatcher): void
    {
        $events = \array_merge_recursive(
            (\method_exists($this, 'discoveredEvents') ? $this->discoveredEvents() : []),
            $this->listens()
        );

        foreach ($events as $event => $listeners) {
            foreach (\array_unique($listeners) as $listener) {
                $dispatcher->listen($event, $listener);
            }
        }

        foreach ($this->subscribe as $subscriber) {
            $dispatcher->subscribe($subscriber);
        }
    }
578108
public function getEventSubscriber($subscriber, $config = array())
    {
        if (! ($subscriber instanceof AnServiceIdentifier)) {
            //Create the complete identifier if a partial identifier was passed
            if (is_string($subscriber) && strpos($subscriber, '.') === false) {
                $identifier = clone $this->getIdentifier();
                $identifier->path = array('event', 'handler');
                $identifier->name = $subscriber;
            } else {
                $identifier = $this->getIdentifier($subscriber);
            }
        }
    
        if (! isset($this->_event_subscribers[(string) $identifier])) {
            $config['event_dispatcher'] = $this->getEventDispatcher();
            $subscriber = $this->getService($identifier, $config);
             
            //Check the event subscriber interface
            if (! ($subscriber instanceof AnEventSubscriberInterface)) {
                throw new AnEventSubscriberException("Event Subscriber $identifier does not implement AnEventSubscriberInterface");
            }
        } else {
            $subscriber = $this->_event_subscribers[(string) $identifier];
        }
         
        return $subscriber;
    }
1001697
public function subscribe(EventInterface $event) {
        $resources = Resource::getAllResources();

        if ($this->params['additionalResources']) {
            $resources = array_merge($resources, $this->params['additionalResources']);
        }

        $events = [];
        foreach ($resources as $resource) {
            $events[$resource] = ['checkAccess' => 500];
        }

        $manager = $event->getManager();
        $manager->addCallbacks($event->getHandler(), $events);
    }
1161353
public function onSubscribe(SubscriberEvent $event)
    {
        $this->listRepository->subscribe(
            $event->getListId(),
            $event->getSubscriber()
        );
    }