Get a list of subscribed events.

Event handlers always start with 'on' and need to be public methods

@return array An array of public methods
778420
public function getSubscriptions()
    {
        if (!$this->__subscriptions) {
            $subscriptions = array();

            //Get all the public methods
            //$reflection = new ReflectionClass($this);
            //foreach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method)
            foreach ($this->getMethods() as $method) {
                if (substr($method, 0, 2) == 'on') {
                    $subscriptions[] = $method;
                }
            }

            $this->__subscriptions = $subscriptions;
        }

        return $this->__subscriptions;
    }
1196585
static private function bindEventListenersEvents()
    {
    	if (self::$_eventListeners && !self::$_elInstances) {
    		foreach (self::$_eventListeners as $class => $listeners) {
    			if ($listeners) foreach ($listeners as $listener) {
    				
    				$listener = self::getListener($listener);
    				
    				$events = $listener->events();
    				
    				if ($events) foreach ($events as $name => $handler) {
    					Event::on($class, $name, is_string($handler) ? [$listener, $handler] : $handler);
    				}
    			}
    		}
    	}
    }
136331
private function getDatabaseStructureEvents()
    {
        // Listing all events from database
        if ($this->dumpSettings['events']) {
            foreach ($this->dbHandler->query($this->typeAdapter->show_events($this->dbName)) as $row) {
                array_push($this->events, $row['event_name']);
            }
        }
        return;
    }
534215
public function implementedEvents()
    {
        $events = parent::implementedEvents();

        $events['Crud.beforeRender'][] = ['callable' => [$this, 'publishSuccess']];

        if (method_exists($this, 'viewVar')) {
            $events['Crud.beforeRender'][] = ['callable' => [$this, 'publishViewVar']];
        }

        return $events;
    }
923050
private function getListenersForEvent($event) {
        $listeners = [];

        foreach ($this->getEventNameParts($event) as $name) {
            if (isset($this->callbacks[$name])) {
                foreach (clone $this->callbacks[$name] as $listener) {
                    $listeners[] = $listener;
                }
            }
        }

        return $listeners;
    }
682845
public function getAllActiveEvents(): array
    {
        $activeEvents = [];
        foreach (self::$eventsMap as $eventName => $eventClass) {
            if (!class_exists($eventClass)) {
                continue;
            }

            $activeEvents[] = $eventName;
        }

        $listeners = $this->eventDispatcher->getListeners();
        $activeEvents = array_unique(array_merge($activeEvents, array_keys($listeners)));

        asort($activeEvents);

        return $activeEvents;
    }
120456
public function getSortedEvents() {
		if ($events = $this->getEvents()) {
			usort(
				$events, function ($a, $b) {
				return $a['DTSTART'] > $b['DTSTART'];
			}
			);
			return $events;
		}
		return [];
	}
50826
public static function getSubscribedEvents()
    {
        return [
            ContaoEvents::CONTROLLER_ADD_TO_URL                => 'handleAddToUrl',
            ContaoEvents::CONTROLLER_ADD_ENCLOSURE_TO_TEMPLATE => 'handleAddEnclosureToTemplate',
            ContaoEvents::CONTROLLER_ADD_IMAGE_TO_TEMPLATE     => 'handleAddImageToTemplate',
            ContaoEvents::CONTROLLER_GENERATE_FRONTEND_URL     => 'handleGenerateFrontendUrl',
            ContaoEvents::CONTROLLER_GET_ARTICLE               => 'handleGetArticle',
            ContaoEvents::CONTROLLER_GET_CONTENT_ELEMENT       => 'handleGetContentElement',
            ContaoEvents::CONTROLLER_GET_PAGE_DETAILS          => 'handleGetPageDetails',
            ContaoEvents::CONTROLLER_GET_TEMPLATE_GROUP        => 'handleGetTemplateGroup',
            ContaoEvents::CONTROLLER_LOAD_DATA_CONTAINER       => 'handleLoadDataContainer',
            ContaoEvents::CONTROLLER_REDIRECT                  => 'handleRedirect',
            ContaoEvents::CONTROLLER_RELOAD                    => 'handleReload',
            ContaoEvents::CONTROLLER_REPLACE_INSERT_TAGS       => 'handleReplaceInsertTags',
        ];
    }
967166
public function getListeners(AbstractEvent $event, $asynchronous = false)
    {
        return array_filter(
            $this->listeners,
            function (EventListener $eventSubscriber) use ($asynchronous, $event) {
                $supportedEvent = $eventSubscriber->getEventClassName();

                if ($eventSubscriber->isAsynchronous() !== $asynchronous) {
                    return false;
                }
                if (null === $supportedEvent) {
                    return true;
                }

                return $event instanceof $supportedEvent;
            }
        );
    }
806255
public function implementedEvents()
    {
        $events = [];
        if ($this->getConfig('events') === false) {
            return $events;
        }
        foreach ((array)$this->getConfig('events') as $eventKey => $event) {
            if (is_numeric($eventKey)) {
                $eventKey = $event;
                $event = null;
            }
            if ($event === null || is_string($event)) {
                $event = ['callable' => $event];
            }
            if (!is_array($event)) {
                throw new \InvalidArgumentException('Event should be string or array');
            }
            $priority = $this->getConfig('priority');
            if (!array_key_exists('callable', $event) || $event['callable'] === null) {
                list(, $event['callable']) = pluginSplit($eventKey);
            }
            if ($priority && !array_key_exists('priority', $event)) {
                $event['priority'] = $priority;
            }
            $events[$eventKey] = $event;
        }

        return $events;
    }
132931
public static function get_observer_list() {
        $events = \core\event\manager::get_all_observers();
        foreach ($events as $key => $observers) {
            foreach ($observers as $observerskey => $observer) {
                $events[$key][$observerskey]->parentplugin =
                        \core_plugin_manager::instance()->get_parent_of_subplugin($observer->plugintype);
            }
        }
        return $events;
    }
591323
public function onRefresh()
    {
        $result = [];
        $saveData = $this->getSaveData();

        /**
         * @event backend.form.beforeRefresh
         * Called before the form is refreshed, modify the $dataHolder->data property in place
         *
         * Example usage:
         *
         *     Event::listen('backend.form.beforeRefresh', function((\Backend\Widgets\Form) $formWidget, (stdClass) $dataHolder) {
         *         $dataHolder->data = $arrayOfSaveDataToReplaceExistingDataWith;
         *     });
         *
         * Or
         *
         *     $formWidget->bindEvent('form.beforeRefresh', function ((stdClass) $dataHolder) {
         *         $dataHolder->data = $arrayOfSaveDataToReplaceExistingDataWith;
         *     });
         *
         */
        $dataHolder = (object) ['data' => $saveData];
        $this->fireSystemEvent('backend.form.beforeRefresh', [$dataHolder]);
        $saveData = $dataHolder->data;

        /*
         * Set the form variables and prepare the widget
         */
        $this->setFormValues($saveData);
        $this->prepareVars();

        /**
         * @event backend.form.refreshFields
         * Called when the form is refreshed, giving the opportunity to modify the form fields
         *
         * Example usage:
         *
         *     Event::listen('backend.form.refreshFields', function((\Backend\Widgets\Form) $formWidget, (array) $allFields) {
         *         $allFields['name']->required = false;
         *     });
         *
         * Or
         *
         *     $formWidget->bindEvent('form.refreshFields', function ((array) $allFields) {
         *         $allFields['name']->required = false;
         *     });
         *
         */
        $this->fireSystemEvent('backend.form.refreshFields', [$this->allFields]);

        /*
         * If an array of fields is supplied, update specified fields individually.
         */
        if (($updateFields = post('fields')) && is_array($updateFields)) {

            foreach ($updateFields as $field) {
                if (!isset($this->allFields[$field])) {
                    continue;
                }

                /** @var FormWidgetBase $fieldObject */
                $fieldObject = $this->allFields[$field];
                $result['#' . $fieldObject->getId('group')] = $this->makePartial('field', ['field' => $fieldObject]);
            }
        }

        /*
         * Update the whole form
         */
        if (empty($result)) {
            $result = ['#'.$this->getId() => $this->makePartial('form')];
        }

        /**
         * @event backend.form.refresh
         * Called after the form is refreshed, should return an array of additional result parameters.
         *
         * Example usage:
         *
         *     Event::listen('backend.form.refresh', function((\Backend\Widgets\Form) $formWidget, (array) $result) {
         *         $result['#my-partial-id' => $formWidget->makePartial('$/path/to/custom/backend/partial.htm')];
         *         return $result;
         *     });
         *
         * Or
         *
         *     $formWidget->bindEvent('form.refresh', function ((array) $result) use ((\Backend\Widgets\Form $formWidget)) {
         *         $result['#my-partial-id' => $formWidget->makePartial('$/path/to/custom/backend/partial.htm')];
         *         return $result;
         *     });
         *
         */
        $eventResults = $this->fireSystemEvent('backend.form.refresh', [$result], false);

        foreach ($eventResults as $eventResult) {
            $result = $eventResult + $result;
        }

        return $result;
    }
994722
public function getSubscriptions()
    {
        $url = $this->accountsEndpoint . 'subscriptions';
        return Subscription::getCollection($url, 0, [], $this->connector->getClient());
    }
635981
protected function getEventSubscribers()
    {
        $eventSubscribers = $this->getOption('event_subscribers');

        if (is_null($eventSubscribers) || !is_array($eventSubscribers)) {
            return;
        }

        return array_filter(
            $eventSubscribers,
            function ($subscriber) {
                return $subscriber instanceof EventSubscriber;
            }
        );
    }
643865
protected function getEvents() {
        if (!$this->_events) {
            $this->_events = new EventList($this->version, $this->solution['sid']);
        }

        return $this->_events;
    }
505386
public function actionEvents() {

		$user = Yii::$app->user->GetIdentity();

		$startDate	= Yii::$app->request->post( 'startDate' );
		$endDate	= Yii::$app->request->post( 'endDate' );

		$events = $this->modelService->getByRangeUserId( $startDate, $endDate, $user->id );
		$data	= [];

		foreach( $events as $event ) {

			$data[] = [ 'id' => $event->id, 'title' => "$event->name - $event->description", 'start' => $event->scheduledAt ];
		}

		// Trigger Ajax Success
		return AjaxUtil::generateSuccess( Yii::$app->coreMessage->getMessage( CoreGlobal::MESSAGE_REQUEST ), $data );
	}
93571
public function getListeners($event)
    {
        $parentListeners = [];
        $wildcards = [];

        if( is_object($event) )
        {
            $eventName = get_class($event);
            $parentListeners = $this->getParentListeners($event);
        }
        else
        {
            $eventName = $event;
            $wildcards = $this->getWildcardListeners($event);
        }

        if (!isset($this->sorted[$eventName])) {
            $this->sortListeners($eventName);
        }

        return array_merge($this->sorted[$eventName], $wildcards, $parentListeners);
    }