attaches further Listeners for generating / processing the output

@return $this
188979
public function attachDefaultListeners()
    {
        parent::attachDefaultListeners();

        $serviceLocator  = $this->serviceLocator;
        $defaultServices = $serviceLocator->get('DefaultListeners');
        $events          = $this->getEventManager();
        $events->attach($defaultServices);

        return $this;
    }
852575
public function disable(): self
    {
        if (!empty($this->logs)) {
            $this->logs->removeListener($this);
        }

        return $this;
    }
483542
protected function outputResults()
    {
        $this->output();
        $this->output('Finished:');
        foreach ($this->results as $metric => $count) {
            $this->output('+ ' . $metric . ': ' . $count);
        }
        return $this;
    }
528689
protected function listenForEvents()
	{
		$this->laravel['events']->listen(JobProcessed::class, function ($event) {
			$this->writeOutput($event->job, false);
		});

		$this->laravel['events']->listen(JobFailed::class, function ($event) {
			$this->writeOutput($event->job, true);
		});
	}
318750
public function onPrePersist() {
    $this->generateSlugs();

    if (!isset($this->created)) {
      $this->created = \Psc\DateTime\DateTime::now();
    }
    $this->updated = \Psc\DateTime\DateTime::now();

    return $this;
  }
1169695
public function load()
    {
        if (false === $this->isLoaded) {
            $this->getEventManager()->trigger(
                __FUNCTION__ . '.pre',
                $this,
                []
            );

            $this->generate();
            $this->injectBlocks();
            $this->isLoaded = true;

            $this->getEventManager()->trigger(
                __FUNCTION__ . '.post',
                $this,
                []
            );
        }
        return $this;
    }
251565
public function addGenerator()
    {
        if ($this->version == Feed::ATOM)
            $this->setChannelElement('atom:generator', 'FeedWriter', array('uri' => 'https://github.com/mibe/FeedWriter'));
        else if ($this->version == Feed::RSS2)
            $this->setChannelElement('generator', 'FeedWriter');
        else
            throw new InvalidOperationException('The generator element is not supported in RSS1 feeds.');

        return $this;
    }
166160
protected function attachSelfToEventManager()
    {
        if (!$this->listener_attached) {
            if ($this->event_manager instanceof ListenerAwareInterface &&
                $this instanceof ListenerInterface
            ) {
                $this->event_manager->attachListener($this);
            }
            $this->listener_attached = true;
        }
    }
329298
public function disableOutput()
    {
        if ($this->isRunning()) {
            throw new RuntimeException('Disabling output while the process is running is not possible.');
        }
        if (null !== $this->idleTimeout) {
            throw new LogicException('Output can not be disabled while an idle timeout is set.');
        }

        $this->outputDisabled = true;

        return $this;
    }
474744
public function clearOutput()
    {
        ftruncate($this->stdout, 0);
        fseek($this->stdout, 0);
        $this->incrementalOutputOffset = 0;

        return $this;
    }
424746
public function initializeEventListeners()
    {
        $configuration = $this->getConfiguration();
        $eventDispatcher = $this->getContainer()->get('event_dispatcher');
        foreach ($configuration->getEventListeners() as $eventName => $listeners) {
            foreach ($listeners as $listener) {
                list($listenerClassName, $listenerMethodName) = explode('::', $listener);

                $listenerInstance = ObjectFactory::getInstance()->newInstance($listenerClassName);
                if ($listenerInstance !== null) {
                    $eventDispatcher->addListener($eventName, array($listenerInstance, $listenerMethodName));
                }
            }
        }

        foreach ($configuration->getEventSubscribers() as $subscriber) {
            $subscriberInstance = ObjectFactory::getInstance()->newInstance($subscriber['class'], $subscriber);
            if ($subscriberInstance instanceof EventSubscriberInterface) {
                $eventDispatcher->addSubscriber($subscriberInstance);
            }
        }
    }
229819
function _addListeners() {
        if (_automaticSort && _currentSort && _currentSort.getEvents()) {
            MainViewManager
                .on(_currentSort.getEvents(), function () {
                    _currentSort.sort();
                })
                .on("_workingSetDisableAutoSort.sort", function () {
                    setAutomatic(false);
                });
        }
    }
864685
private function registerEventListeners()
    {
        $listeners = $this->getListeners();
        foreach ($listeners as $listenerKey => $listenerValues) {
            foreach ($listenerValues as $listenerValue) {
                \Event::listen($listenerKey,
                    $listenerValue
                );
            }
        }
    }
354621
protected function _detachListeners()
    {
        $EventManager = EventManager::instance();
        foreach ($this->_listeners as $listener) {
            $EventManager->detach($listener);
        }
    }
327930
protected function listen()
    {
        $events = app('events');
        if (isset($this->listen)) {
            foreach ($this->listen as $event => $listeners) {
                foreach ($listeners as $listener) {
                    $events->listen($event, $listener);
                }
            }
        }
        
        if (isset($this->subscribe)) {
            foreach ($this->subscribe as $subscriber) {
                $events->subscribe($subscriber);
            }
        }
    }
637385
function produces() {
		foreach ( func_get_args() as $what ) $this->resource($what)->isProducedBy($this);
		return $this;
	}
1335308
private function registerListeners(): void
    {
        Event::listen(ReactionHasBeenAdded::class, IncrementAggregates::class);
        Event::listen(ReactionHasBeenRemoved::class, DecrementAggregates::class);
    }