/** * Create a WorkflowEvent instance. * * @param string $name name of the event. * @param array $config configuration array that may contain following keys : 'start', 'end', 'transition' */ public function __construct($name, array $config = []) { if (empty($name)) { throw new WorkflowException('Failed to create event instance : missing $name value'); } else { $this->name = $name; } if (isset($config['start'])) { $this->_start = $config['start']; unset($config['start']); } if (isset($config['end'])) { $this->_end = $config['end']; unset($config['end']); } if (isset($config['transition'])) { $this->_transition = $config['transition']; unset($config['transition']); } unset($config['name']); parent::__construct($config); }