Loop through and execute each member of the collection
@param string $event
334143
public function execute(string $event)
    {
        foreach ($this->members as $member) {
            if ($member->getEvent() === $event) {
                $member->execute();
            }
        }
    }
1340925
public function dispatch(Event $event) {

		$this->lastEvent = $event;
		$eventName = $event->getName();

		if (isset($this->registry[$eventName])) {

			foreach ($this->getSortedRegistry($eventName) as $listener) {
				call_user_func($listener, $event);
			}
			
		}

	}
1125209
public function remove($event = null)
    {
        if (!is_null($event)) {
            unset($this->events[$event]);
        }

        $this->events = [];
    }
604680
public function triggerEvent(string $event): void
    {
        // TODO: use event library and allow attach events to IFile and ICacheStateful.
        // cache triggers
        if ($this->file instanceof ICacheStateful) {
            switch ($event) {
                case self::EVENT_CACHED:
                    $this->file->setCachedAt($this->name, time());
                    break;
                case self::EVENT_EMPTY:
                case self::EVENT_ERROR:
                case self::EVENT_NOT_FOUND:
                    // TODO: split those and save different cases of cache state.
                    $this->file->setCachedAt($this->name, null);
                    break;
            }

            $this->file->saveState();
        }

        // other triggers
    }
602046
public function attach($event)
    {
        $this->attachRows($event);
        $this->attachSeo($event);
        $this->attachAnonsModule($event);
    }
186925
public function listen($event, \Closure $callback): void
    {
        // check if $event is a single string and set it as array with one item
        if (!Any::isArray($event)) {
            $event = [$event];
        }
        
        // each every one event in array
        foreach ($event as $item) {
            if (Any::isArray($this->runned) && array_key_exists($item, $this->runned)) {
                call_user_func_array($callback, $this->runned[$item]);
            }
        }
    }
154428
function clearEventHandlers($event = null)
	{
		if (!empty($event)) {
			$this->_events[$event] = array();
		}
		else {
			$this->_events = array();
		}
	}
1318203
public function onPostBind($event)
    {
        $form = $event->getForm();

        if ( ! $form->isRoot()) return;

        $clientData = $event->getForm()->getData();

        if ( ! is_object($clientData)) return;

        $this->filterService->filterEntity($clientData);

    }
933667
public function dispatch($event): void
    {
        Assertion::isObject($event, 'An event should be an object');

        $eventName = get_class($event);
        $eventSubscribers = array_merge(
            $this->subscribedToAllEvents,
            $this->subscribers[$eventName] ?? []
        );

        foreach ($eventSubscribers as $eventSubscriber) {
            $eventSubscriber($event);
        }
    }
881764
function handle(Event $event)
    {
        if ($this->accept($event)) {
            $this->onEvent($event);
            return true;
        }

        return false;
    }
190132
public function add_listener($event) {
		if (strpos('::', $event) === false) {
			$classname = get_called_class();
			$method = $event;
		} else {
			list($classname, $method) = explode('::', $event);
		}
		$event_name = strtolower(str_replace('\\', '_', $classname . '_' . $method));

		$dispatcher = \Skeleton\Event\Dispatcher::get();
		$dispatcher->add_listener($event_name, [ '\\Event\\' . $classname, $method ]);
	}
1262693
public function handle($event)
    {
        switch (get_class($event)) {
            case AfterMassActionsAction::class:
                $actions = $event->massActions;
                $row = $event->model;
                break;

            case BeforeMassActionsAction::class:
                $actions = $event->massActions;
                $row = $event->model;
                break;

            case AfterTableAction::class:
                $actions = $event->tableActions;
                $row = $event->row;
                break;

            case BeforeTableAction::class:
                $actions = $event->tableActions;
                $row = $event->row;
                break;
        }

        $elements = $this->getActions($row);
        $return   = [];

        foreach ($elements as $element) {
            $resolved = $this->resolveDatatableAction($actions, $row, $element);
            if (is_array($resolved)) {
                $return[] = $resolved;
            }
        }


        return count($return) ? array_merge(...$return) : [];
    }
833627
public function handleRecursively(Event $event): void
    {
        $this->handle($event);

        foreach ($this->childEntities() as $entity) {
            $entity->registerAggregateRoot($this->getAggregateRoot());
            $entity->handleRecursively($event);
        }
    }
609492
public function dispatchEvent($event) {
		$type = $event->getType();
		if (isset($this->eventsListeners[$type])) {
			for ($j = 0; $j < count($this->eventsListeners[$type]); $j++) {
				list($plugin, $action) = explode(':', $this->eventsListeners[$type][$j]);
				//加载plugin && 调用action
				//echo $type.'<br/>';
				$this->app->runPluginAction($plugin, $action, $event);
			}
		}
		
	}
485387
public function handle($event)
    {
        $method = $this->getMethodFor($event);

        if (method_exists($this, $method)) {
            return call_user_func([$this, $method], $event);
        }
    }
842063
public function observe($event)
	{
		foreach ($this->observers() as $observer => $settings)
		{
			$events = isset($settings['events']) ? $settings['events'] : array();
			if ((empty($events) or in_array($event, $events))
				and empty($this->_disabled_events[$event]))
			{
				if ( ! class_exists($observer))
				{
					$observer_class = \Inflector::get_namespace($observer).'Observer_'.\Inflector::denamespace($observer);
					if ( ! class_exists($observer_class))
					{
						throw new \UnexpectedValueException($observer);
					}

					// Add the observer with the full classname for next usage
					unset(static::$_observers_cached[$observer]);
					static::$_observers_cached[$observer_class] = $events;
					$observer = $observer_class;
				}

				try
				{
					call_user_func(array($observer, 'orm_notify'), $this, $event);
				}
				catch (\Exception $e)
				{
					// Unfreeze before failing
					$this->unfreeze();

					throw $e;
				}
			}
		}
	}
375158
public function add($event) {
        $event->setParent($this->_parent);
        $this->_events[$event->getName()] = $event;
    }