Fires an event.

@param string $eventName
@param array $params

@return Event object
335124
public function fire($eventName, array $params = array())
    {
        $event = new Event($eventName, $params);
        $this["dispatcher"]->dispatch($event);

        return $event;
    }
348072
public function call($event, array $params = array())
    {

        // Include an instance of this object as the final argument
        $params[] = $this;

        if (isset($this->_hooks[$event])) {
            foreach($this->_hooks[$event] as $hook) {
                call_user_func_array($hook, $params);
            }
        }

        return $this;
    }
1310663
public function dispatch($eventName, Event $event = null)
    {
        if (null === $event) {
            $event = new Event();
        }

        $event->setDispatcher($this);
        $event->setName($eventName);

        if (!isset($this->listeners[$eventName])) {
            return $event;
        }

        $this->doDispatch($this->getListeners($eventName), $eventName, $event);

        return $event;
    }
149340
public function unsubscribeEvent($eventName)
    {
        if (!isset($this->subscribedEvents[$eventName])) {
            throw new InvalidArgumentException("Event $eventName doesn't exists in client context");
        }

        $this->subscribedEvents[$eventName] = false;
    }
455414
protected function fireEvent($eventName, array $vars = array(), $halt = true)
    {
        $method    = $halt ? 'until' : 'fire';
        $eventName = sprintf('%s:%s', $this->name(), $eventName);

        return Subbly::events()->{$method}($eventName, $vars);
    }
1041387
protected function triggerEvent($eventName, NodeInterface $node = null)
    {
        if (isset($this->activeEvents[$eventName])) {
            $this->dispatcher->dispatch($eventName, $this->sharedEvent->setNode($node));
        }

        return $this;
    }
1070169
protected function registerEvent($eventName, $funcName)
    {
        \OWeb\manage\events::getInstance()->registerEvent($eventName, $this, $funcName);
    }
1186842
public function execute($commandName, $params = [])
    {
        $className = str_replace(' ', '', ucwords(str_replace('-', ' ', $commandName))) . 'Command';
        $clearCommandName = $this->getNamespace() . "\\console\\" . $className;
        if (!class_exists($clearCommandName)) $clearCommandName = '\\app\\console\\' . $className;
        if (!class_exists($clearCommandName)) $clearCommandName = 'PhpDevil\\framework\\console\\commands\\' . $className;
        if (!class_exists($clearCommandName)) die("\nCommand " . $commandName . " not found");
        (new $clearCommandName)->execute($params);
    }
433466
protected function _triggerEvent($eventName, $entity, $eventArgs)
    {
        if (null === $this->_application) {
            return;
        }

        $dispatcher = $this->_application->getEventDispatcher();
        if (null !== $dispatcher) {
            $dispatcher->triggerEvent($eventName, $entity, $eventArgs);
        }
    }
591912
public static function fire( $event, $params = array() ) {
		
		if ( !array_key_exists( $event, static::$events ) ) {
			return;
		}
		
		$event = static::$events[$event];
		$return = array();
		
		if ( array_key_exists( 'before', $event ) ) {
			$return['before'] = static::call( $event['before'], $params );
		}
		
		if ( array_key_exists( 'callbacks', $event ) ) {
			$return['main'] = static::call( $event['callbacks'], $params );
		}
		
		if ( array_key_exists( 'after', $event ) ) {
			$return['after'] = static::call( $event['after'], $params );
		}
		
		return static::pack( $return );
	}
682314
public function subscribeEvent($eventName)
    {
        if (!isset($this->subscribedEvents[$eventName])) {
            throw new InvalidArgumentException("Event $eventName doesn't exists in client context");
        }

        $this->subscribedEvents[$eventName] = true;
    }
506318
public function dispatch($eventName, $params)
    {
        if (isset($this->enabledProviderListeners[$eventName])) {
            foreach ($this->enabledProviderListeners[$eventName] as $callback) {
                call_user_func_array($callback, $params);
            }
        }
    }
3086
private function callListener(string $eventName, array $withArgs)
    {
        $listener = Container\get($eventName);

        if (is_callable($listener)) {
            return call_user_func_array($listener, $withArgs);
        }

        return null;
    }
1143160
protected function fireEvent($eventName, Event $event)
    {
        if (!$this->eventDispatcher) {
            throw new \BadMethodCallException(sprintf(
                'Method %s() cannot be used while event dispatcher is not configured.',
                __METHOD__
            ));
        }

        $this->eventDispatcher->dispatch($eventName, $event);
    }
1362205
protected function dispatch($eventName, ActionEvent $event = null)
    {
        if ($event == null) {
            $event = new DefaultActionEvent();
        }

        $this->getDispatcher()->dispatch($eventName, $event);
    }
1098764
public function fire($name, $params = [])
    {
        if ($this->prefixEventName === null) {
            $reflector = new \ReflectionClass($this);
            $this->prefixEventName = 'e' . $reflector->getShortName();
        }
        
        $event = new Event($params);
        if (method_exists($this, $this->prefixEventHandler . $name)) {
            call_user_func([$this, $this->prefixEventHandler . $name], $event);
        }
        Yii::$app->trigger($this->prefixEventName . ucfirst($name), $event);
    }
544095
public function dispatch($eventName, sfEvent $event = null)
    {
        if (null !== $this->application) {
            $this->application->debug(sprintf('Dispatching `%s` event.', $eventName));
        }

        return parent::dispatch($eventName, $event);
    }