Factory/PipelineFactory.php
public function buildAction($pipeline, $actionName, $actionConfiguration = [])
    {
        $triggeredByEvents = is_array($actionConfiguration) && array_key_exists("triggered_by_events", $actionConfiguration) ? $actionConfiguration["triggered_by_events"] : [];

        if (empty($triggeredByEvents)) {
            // default behavior : auto-wiring action to the same event name
            $triggeredByEvents = [$actionName];
        }

        // create the action and the action creator
        $action = new Action($actionName);
        $actionCreator = new ActionCreator($action);
        foreach ($triggeredByEvents as $triggeredByEvent) {
            $event = $pipeline->hasIncomingEvent($triggeredByEvent) ? $pipeline->getIncomingEvent($triggeredByEvent) : new Event($triggeredByEvent);
            $actionCreator->addTriggeredByEvent($event);
            $pipeline->addIncomingEvent($event);
        }
        $pipeline->addAction($action);
        $pipeline->addActionCreator($actionCreator);
    }
public function buildAction($pipeline, $actionName, $actionConfiguration = [])
    {
        $triggeredByEvents = is_array($actionConfiguration) && array_key_exists("triggered_by_events", $actionConfiguration) ? $actionConfiguration["triggered_by_events"] : [];

        if (empty($triggeredByEvents)) {
            // default behavior : auto-wiring action to the same event name
            $triggeredByEvents = [$actionName];
        }

        // create the action and the action creator
        $action = new Action($actionName);
        $actionCreator = new ActionCreator($action);
        foreach ($triggeredByEvents as $triggeredByEvent) {
            $event = $pipeline->hasIncomingEvent($triggeredByEvent) ? $pipeline->getIncomingEvent($triggeredByEvent) : new Event($triggeredByEvent);
            $actionCreator->addTriggeredByEvent($event);
            $pipeline->addIncomingEvent($event);
        }
        $pipeline->addAction($action);
        $pipeline->addActionCreator($actionCreator);
    }
public function buildAction ( $ pipeline , $ actionName , $ actionConfiguration = [ ] ) { $ triggeredByEvents = is_array ( $ actionConfiguration ) && array_key_exists ( "triggered_by_events" , $ actionConfiguration ) ? $ actionConfiguration [ "triggered_by_events" ] : [ ] ; if ( empty ( $ triggeredByEvents ) ) { // default behavior : auto-wiring action to the same event name $ triggeredByEvents = [ $ actionName ] ; } // create the action and the action creator $ action = new Action ( $ actionName ) ; $ actionCreator = new ActionCreator ( $ action ) ; foreach ( $ triggeredByEvents as $ triggeredByEvent ) { $ event = $ pipeline -> hasIncomingEvent ( $ triggeredByEvent ) ? $ pipeline -> getIncomingEvent ( $ triggeredByEvent ) : new Event ( $ triggeredByEvent ) ; $ actionCreator -> addTriggeredByEvent ( $ event ) ; $ pipeline -> addIncomingEvent ( $ event ) ; } $ pipeline -> addAction ( $ action ) ; $ pipeline -> addActionCreator ( $ actionCreator ) ; }
Add actions inside Pipeline based on the configuration provided by Symfony Configuration
@param Pipeline $pipeline
@param string $actionName
@param array $actionConfiguration
Add actions inside Pipeline based on the configuration provided by Symfony Configuration