Add listeners
@param \Illuminate\Events\Dispatcher $obEvent
1387
public function subscribe($obEvent)
    {
        parent::subscribe($obEvent);

        Product::extend(function ($obModel) {
            /** @var Product $obModel */
            $bSlugIsTranslatable = Settings::getValue('slug_is_translatable');
            if ($bSlugIsTranslatable) {
                $obModel->translatable[] = ['slug', 'index' => true];
            }
        });
    }
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);
	}
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);
    }
259401
public function onEvent(Event $anyEvent, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (isset($this->propagations[$eventName])) {
            foreach ($this->propagations[$eventName] as $builder) {
                $builder->buildAndForwardEvent($anyEvent);
            }
        }
    }
1362064
protected function propagateCollectionChangedEvent(CollectionChangedEvent $event)
    {
        foreach ($this->collection_listeners as $listener) {
            $listener->onCollectionChanged($event);
        }
    }
267849
public static void on(String op, OnListener listener) {
        getInstance().mEvents.add(new Event(op, listener));
    }
1111178
public function listen($events, $listener, $priority = 0)
    {
        //$priority = sprintf('p:%s', str_pad($priority, 6, '0', STR_PAD_LEFT));

        foreach ((array) $events as $event) {
            $this->listeners[$event][$priority][] = $this->makeListener($listener);
        }
    }
947685
protected function on($events, $handler)
    {
        $dispatcher = $this->app->make('events');
        $dispatcher->listen($events, $handler);
    }
879
public static function flushEventListeners()
    {
        if (! isset(static::$dispatcher)) {
            return;
        }

        $instance = new static;

        foreach ($instance->getObservableEvents() as $event) {
            static::$dispatcher->forget("eloquent.{$event}: ".static::class);
        }

        foreach (array_values($instance->dispatchesEvents) as $event) {
            static::$dispatcher->forget($event);
        }
    }
639465
public function addListener(string $eventName, $listener) : void
    {
        $this->dispatcher->addListener($eventName, $listener);
    }
507435
public function addListeners($event, $listeners)
    {
        foreach ($listeners as $listener) {
            $this->addListener($event, $listener);
        }
    }
251246
public function subscribe($obEvent)
    {
        parent::subscribe($obEvent);

        PromoBlock::extend(function ($obModel) {
            /** @var PromoBlock $obModel */
            $bSlugIsTranslatable = Settings::getValue('slug_is_translatable');
            if ($bSlugIsTranslatable) {
                $obModel->translatable[] = ['slug', 'index' => true];
            }
        });

        $obEvent->listen('shopaholic.promo_block.update.sorting', function () {
            $this->clearSortingList();
        });
    }
1059495
public function listen($events, $listener, $priority = 0)
    {
        if ($priority === 0) {
            $this->events->on($events, $listener);
            return;
        }

        if ($priority > 5) {
            $this->events->onBefore($events, $listener);
            return;
        }

        $this->events->onAfter($events, $listener);

    }
776773
public function subscribe(Dispatcher $events)
    {
        if (!app()->make('antares.installed')) {
            return;
        }

        $events->listen(
                ComponentActivated::class, static::class . '@onActivated'
        );

        $events->listen(
                ComponentInstalled::class, static::class . '@onInstalled'
        );

        $events->listen(
                ComponentDeactivated::class, static::class . '@onDeactivated'
        );

        $events->listen(
                ComponentUninstalled::class, static::class . '@onUninstalled'
        );

        $events->listen(
            ComponentInstallationFailed::class, static::class . '@onFailed'
        );

        $events->listen(
                Failed::class, static::class . '@onComposerFailed'
        );
    }
592581
public function listen($events, $listener, $priority = 0)
    {
        foreach ((array) $events as $event) {
            if (mb_strpos($event, '*') !== false) {
                $this->setupWildcardListen($event, $listener);
            } else {
                $this->listeners[$event][$priority][] = $this->makeListener($listener);

                unset($this->sorted[$event]);
            }
        }
    }
878298
public function addListeners(array $events_config)
    {
        foreach ($events_config as $name => $listeners) {
            if (false === array_key_exists('listeners', $listeners)) {
                $this->application->warning("None listener found for `$name` event.");
                continue;
            }

            $listeners['listeners'] = (array) $listeners['listeners'];
            foreach ($listeners['listeners'] as $listener) {
                $this->addListener($name, $listener);
            }
        }
    }
524668
public function addListener(Listener $listener) : void {
        $this->listeners = $this->listeners->add($listener);
    }