src/Events/EmitterFactory.php
/**
     * The factory method that creates a new emitter instance.
     *
     * @return void
     */
The factory method that creates a new emitter instance.
@return void
The factory method that creates a new emitter instance . @return void
public function createEmitter()
    {
        $this->loadListeners($this->configurationManager->getConfiguration());
        $operations = $this->configurationManager->getOperations();
        foreach ($operations as $operation) {
            $this->loadListeners($operation);
            foreach ($operation->getPlugins() as $plugin) {
                $this->loadListeners($plugin, sprintf('%s.%s', $operationName = $operation->getName(), $pluginName = $plugin->getName()));
                foreach ($plugin->getSubjects() as $subject) {
                    $this->loadListeners($subject, sprintf('%s.%s.%s', $operationName, $pluginName, $subject->getName()));
                }
            }
        }
        return $this->registerListener(new Emitter());
    }
public function createEmitter ( ) { $ this -> loadListeners ( $ this -> configurationManager -> getConfiguration ( ) ) ; $ operations = $ this -> configurationManager -> getOperations ( ) ; foreach ( $ operations as $ operation ) { $ this -> loadListeners ( $ operation ) ; foreach ( $ operation -> getPlugins ( ) as $ plugin ) { $ this -> loadListeners ( $ plugin , sprintf ( '%s.%s' , $ operationName = $ operation -> getName ( ) , $ pluginName = $ plugin -> getName ( ) ) ) ; foreach ( $ plugin -> getSubjects ( ) as $ subject ) { $ this -> loadListeners ( $ subject , sprintf ( '%s.%s.%s' , $ operationName , $ pluginName , $ subject -> getName ( ) ) ) ; } } } return $ this -> registerListener ( new Emitter ( ) ) ; }
The factory method that creates a new emitter instance.
The factory method that creates a new emitter instance .
// load the listener configuration from the configuration // load the operations that has to be executed from the configuration // load, initialize and add the configured listeners for the actual operation /** @var \TechDivision\Import\Configuration\OperationConfigurationInterface $operation */ // load the operation's listeners // load the operation's registered plugins /** @var \TechDivision\Import\Configuration\PluginConfigurationInterface $plugin */ // load the plugin listeners // load the plugin's registered subjects /** @var \TechDivision\Import\Configuration\SubjectConfigurationInterface $subject */ // load the subject listeners // initialize the event emitter, register the listeners