Add listeners
@param \Illuminate\Events\Dispatcher $obEvent
502266
public function subscribe($obEvent)
    {
        $obEvent->listen('backend.list.extendColumns', function ($obWidget) {

            $sControllerClass = $this->getControllerClass();
            $sModelName = $this->getModelClass();

            /** @var \Backend\Widgets\Lists $obWidget */
            if (!$obWidget->getController() instanceof $sControllerClass) {
                return;
            }

            if (!$obWidget->model instanceof $sModelName) {
                return;
            }

            $this->extendColumns($obWidget);
        }, $this->iPriority);
    }
259401
public function onEvent(Event $anyEvent, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (isset($this->propagations[$eventName])) {
            foreach ($this->propagations[$eventName] as $builder) {
                $builder->buildAndForwardEvent($anyEvent);
            }
        }
    }
47852
public function listenDispatchEvents(Listener\Dispatch $listener)
    {
        $this->di
                ->get('eventsManager')
                ->attach('dispatch', $listener, PHP_INT_MAX);
        return $this;
    }
98161
public function registerEventListeners(DispatcherContract $events)
    {
        foreach ($this->listen as $event => $listeners) {
            $defaultPriority = 0;
            if (!is_array($listeners)) {
                $events->listen($event, $listeners);
                continue;
            }
            foreach ($listeners as $listener => $priority) {
                if (is_numeric($listener)) {
                    $listener = $priority;
                    $priority = $defaultPriority;
                }
                if (is_array($listener)) {
                    $priority = is_numeric(current($listener)) ? current($listener) : $defaultPriority;
                    $listener = key($listener);
                }
                $events->listen($event, $listener, $priority);
            }
        }
        foreach ($this->subscribe as $subscriber) {
            $events->subscribe($subscriber);
        }
    }
1182419
public synchronized void addListener(CollectionProxyListener listener)
    {
        if (_listeners == null)
        {
            _listeners = new ArrayList();
        }
        // to avoid multi-add of same listener, do check
        if(!_listeners.contains(listener))
        {
            _listeners.add(listener);
        }
    }
494526
public function subscribe(Dispatcher $events)
    {
        foreach ($this->listeners as $name => $handler)
        {
            $events->listen($name, $this->className.'@'.$handler);
        }
    }
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);
    				}
    			}
    		}
    	}
    }
1367213
public function onPostSerialize(ObjectEvent $event)
    {
        $visitor = $event->getVisitor();
        $document = $event->getObject();

        if (!$document instanceof ParentBehavior || !$document->getParent() instanceof UuidBehavior) {
            return;
        }

        $visitor->addData('parentUuid', $document->getParent()->getUuid());
    }
318305
public function eventHandler($e, $obj)
    {
        if (method_exists($this, $e)) {
            call_user_func(array($this, $e), $e, $obj);
        }
    }
185438
public function listen($eventName, $callback)
    {
        if (is_array($eventName)) {
            foreach ($eventName as $evnt) {
                $this["dispatcher"]->addListener($evnt, $callback);
            }
        } else {
            $this["dispatcher"]->addListener($eventName, $callback);
        }
    }
1319178
public function addEventListener($events, $listener)
    {
        // Picks the hash code related to that listener
        $hash = spl_object_hash($listener);

        foreach ((array) $events as $event) {
            // Overrides listener if a previous one was associated already
            // Prevents duplicate listeners on same event (same instance only)
            $this->_listeners[$event][$hash] = $listener;
        }
    }
1131548
protected function registerListeners()
    {
        Orm::addListener(
            $this->entityDescriptor->className(),
            Select::ACTION_BEFORE_SELECT,
            [$this, 'beforeSelect']
        );

        Orm::addListener(
            $this->entityDescriptor->className(),
            Select::ACTION_AFTER_SELECT,
            [$this, 'afterSelect']
        );

        Orm::addListener(
            $this->entityDescriptor->className(),
            Save::ACTION_BEFORE_INSERT,
            [$this, 'beforeSave']
        );

        Orm::addListener(
            $this->entityDescriptor->className(),
            Save::ACTION_BEFORE_UPDATE,
            [$this, 'beforeSave']
        );
    }
256642
public function addListener($eventName, $listener, $priority = 0)
    {
        $this->getDispatcher()->addListener($eventName, $listener, $priority);
    }
406993
public function addSubscriber(SubscriberInterface $subscriber)
    {
        foreach ($subscriber->getSubscriberEvents() as $subscriberEvent => $params) {
            if (is_string($params)) {
                $this->addListener($subscriberEvent, array($subscriber, $params));
            }

            if (is_array($params)) {
                foreach ($params as $param) {
                    $this->addListener($subscriberEvent, array($subscriber, $param));
                }
            }
        }
    }
1068128
public function addOperationListener(OperationListenerInterface $listener, $priority = 0)
    {
        $this->getEventManager()->attach('beforeOperation', [$listener, 'beforeOperation'], $priority);
        $this->getEventManager()->attach('afterOperation', [$listener, 'afterOperation'], $priority);
        $this->getEventManager()->attach('onOperationException', [$listener, 'onOperationException'], $priority);
    }
1041654
public function dispatch() {
		$params = func_get_args();
		$event = array_shift($params);
		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();
		if ($dispatcher->has_listener($event_name) === false) {
			$this->add_listener($event);
		}

		$dispatcher->dispatch($event_name, $params);
	}
821559
protected function _addModuleEvents($aModuleEvents, $sModuleId)
    {
        $aEvents = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModuleEvents');
        if (is_array($aEvents)) {
            $aEvents[$sModuleId] = $aModuleEvents;
        }

        $this->_saveToConfig('aModuleEvents', $aEvents);
    }