Makes sure that $this->events() all events bind $this
@return void
553235
protected function ensureEvents()
	{
		if ($this->_events === null) {
			$this->_events = [];
			if (method_exists($this, 'events')) {
			    if ($events = $this->events()) foreach ($events as $name => $handler) {
					$this->on($name, $handler);
				}
			}
		}
	}
464834
public function dispatch() {
        foreach ($this->_listeners as $key => $listeners) {
            foreach ($this->_events as $events) {
                if (isset($listeners->implementedEvents()[$events->getName()])) {
                    foreach ($listeners->implementedEvents()[$events->getName()] as $event) {
                        if ($events->getStatus() == Event::START && method_exists($listeners, $event)) {
                            ob_start();
                            $this->addError('EVENT call the listener "' . $key . '" "' . get_class($listeners) . '::' . $event . '" for the event "' . $events->getName() . '"', __FILE__, __LINE__, ERROR_INFORMATION);
                            $events->setResult($listeners->$event($events), get_class($listeners) . '::' . $event, get_class($listeners), $event);
                            $output = ob_get_contents();
                            ob_get_clean();

                            $this->addError('[' . $key . '] [' . get_class($listeners) . '::' . $event . '] [' . $events->getName() . "]\n[" . $output . ']', 0, 0, 0, LOG_EVENT);
                        }
                    }
                }
            }
        }
    }
41644
public function setEvents(array $events)
	{
		if ($events) {
			$this->ensureEvents();
			
			foreach ($events as $name => $handler) {
				$this->on($name, $handler);
			}
		}
	}
564255
protected function ensureEventListeners()
	{
		if ($this->_eventListeners === null) {
			$this->_eventListeners = [];
			if (method_exists($this, 'eventListeners')) {
				$this->setEventListeners($this->eventListeners());
			}
		}
	}
229304
protected function __bindEvents()
    {
        $server = $this->swoolePort ?? $this->swooleServer;

        $server->on('packet', function(\swoole_server $server, $data, $clientInfo){
            try{
                $this->trigger('packet', [
                    'server'        => $this,
                    'data'          => $data,
                    'clientInfo'    => $clientInfo,
                ], $this, PacketEventParam::class);
            }
            catch(\Throwable $ex)
            {
                App::getBean('ErrorLog')->onException($ex);
            }
        });
        
    }
173578
public function bind()
    {
        if (func_num_args()) {
            $bindings = new Bindings(func_get_args(), $this->rules);
            $this->rules = $bindings->rules();
        }

        return $this;
    }
345833
function(){
    if (!this.triggers) { return; }

    var triggerEvents = {};

    // Allow `triggers` to be configured as a function
    var triggers = _.result(this, "triggers");

    // Configure the triggers, prevent default
    // action and stop propagation of DOM events
    _.each(triggers, function(value, key){

      // build the event handler function for the DOM event
      triggerEvents[key] = function(e){

        // stop the event in its tracks
        if (e && e.preventDefault){ e.preventDefault(); }
        if (e && e.stopPropagation){ e.stopPropagation(); }

        // build the args for the event
        var args = {
          view: this,
          model: this.model,
          collection: this.collection
        };

        // trigger the event
        this.triggerMethod(value, args);
      };

    }, this);

    return triggerEvents;
  }
1350068
protected function configureEvents(): self
    {
        $container = $this->getContainer();
        $key = 'm6web_daemon.iterations_events';

        if ($container->hasParameter($key)) {
            $this->iterationsEvents = $container->getParameter($key);
        }

        return $this;
    }
254554
private static function event()
    {
        $files = ['Event', 'EventListener'];
        $folder = static::$root.'Event'.'/';

        self::call($files, $folder);

        $files = ['ManyListenersArgumentsException'];
        $folder = static::$root.'Event/Exceptions'.'/';

        self::call($files, $folder);
    }
643734
protected function registerEventRebindHandler()
    {
        $this->app->rebinding('events', function ($app, $dispatcher) {
            if (! $app->resolved('auth')) {
                return;
            }

            if (method_exists($guard = $app['auth']->guard(), 'setDispatcher')) {
                $guard->setDispatcher($dispatcher);
            }
        });
    }
283440
protected function attachEvents(): void
	{
		foreach ($this->router as $route) {
			if ($route instanceof ApiRoute) {
				$route->onMatch[] = [$this, 'routeMatched'];
			}
		}
	}
951979
protected function startListening()
	{
		foreach ($this->eventsToListenFor as $event) {
			if (is_callable([$this, $event])) {
				$this->connection->eventManager()->bind($event, [$this, $event]);
			}
		}
		return $this;
	}
407730
protected function registerCallbacks()
    {
        if (!empty($this->callbacks)) {
            $selector = $this->getSelector();
            $view = $this->getView();
            foreach ($this->callbacks as $event => $callback) {
                if (is_array($callback)) {
                    foreach ($callback as $function) {
                        if (!$function instanceof JsExpression) {
                            $function = new JsExpression($function);
                        }
                        $view->registerJs("jQuery('#$selector').on('$event', $function);");
                    }
                } else {
                    if (!$callback instanceof JsExpression) {
                        $callback = new JsExpression($callback);
                    }
                    $view->registerJs("jQuery('#$selector').on('$event', $callback);");
                }
            }
        }
    }
620921
protected static function events()
    {
        foreach (self::fetch('app/events', false) as $file) {
            Bus::need($file);
        }
        //
        Event::register();
    }
350056
public function activateEventMiddleWare()
    {
        $isEventActive = $this->isEventMiddlewareEnabled();
        $eventClass = Config::get('global.config', 'app.event.class');

        if ($isEventActive && !$this->container->has('event')) {
            $this->container->set('event', $this->container->make($eventClass));
            $this->container->get('event')->register($this->container);

            return true;
        }

        return false;
    }
1151188
public function attachEvents($events=array()) {
		if (\is_array($events)) {
			foreach ( $events as $action => $selector ) {
				$this->attachEvent($selector, $action);
			}
		}
		return $this;
	}
1215958
public function bindPluginEvents(Event $event)
    {
        foreach ($this->plugins as $field => $plugin) {
            $plugin = self::findPluginInstance($field, $plugin, $event->sender->tableName());
            foreach ($plugin->events() as $on => $handler) {
                $event->sender->on($on, is_string($handler) ? [$plugin, $handler] : $handler);
            }
        }
    }