Register an event hook, which
@param $eventType
@param IEventHook $
@return mixed
976378
public function registerHook($eventType, IEventHook $hook)
    {
        switch ($eventType) {
            case IEventHook::EVENT_SAVE_CHANGES:
                $this->getDataUpdater()->registerSaveChangesEventHook($hook);
                break;
            default:
                throw new Exception("Unrecognised type $eventType whilst registering event hook");
        }
    }
1273490
public static IEventTrigger createEventTrigger(final EventType eventType, final AttributeImpl attribute)
            throws DevFailed {
        LOGGER.debug("create event trigger for attribute {} of type {}", attribute.getName(), eventType);
        final EventProperties props = attribute.getProperties().getEventProp();
        IEventTrigger eventTrigger;
        switch (eventType) {
            case PERIODIC_EVENT:
                final long period = Long.parseLong(props.per_event.period);
                eventTrigger = new PeriodicEventTrigger(period, attribute);
                break;
            case CHANGE_EVENT:
                eventTrigger = new ChangeEventTrigger(attribute, props.ch_event.abs_change, props.ch_event.rel_change);
                break;
            case ARCHIVE_EVENT:
                long periodA;
                try {
                    // Check if specified and a number
                    periodA = Long.parseLong(props.arch_event.period);
                } catch (final NumberFormatException e) {
                    periodA = -1;
                }
                eventTrigger = new ArchiveEventTrigger(periodA, props.arch_event.abs_change,
                        props.arch_event.rel_change, attribute);
                break;
            case ATT_CONF_EVENT:
            case DATA_READY_EVENT:
            case USER_EVENT:
            case INTERFACE_CHANGE_EVENT:
            case PIPE_EVENT:
            default:
                eventTrigger = new DefaultEventTrigger();
                break;

        }
        return eventTrigger;
    }
1358006
public static Event map(EventType eventType) {
        Event event = new Event();
        event.setEventType(mapEventTypeEnum(eventType.getEventType()));
        Date date = (eventType.getTimestamp() == null)
                ? new Date() : eventType.getTimestamp().toGregorianCalendar().getTime();
        event.setTimestamp(date);
        event.setOriginator(mapOriginatorType(eventType.getOriginator()));
        MessageInfo messageInfo = mapMessageInfo(eventType.getMessageInfo());
        event.setMessageInfo(messageInfo);
        String content = mapContent(eventType.getContent());
        event.setContent(content);
        event.getCustomInfo().clear();
        event.getCustomInfo().putAll(mapCustomInfo(eventType.getCustomInfo()));
        return event;
    }
612558
void onEvent(EventLog log, EventType eventType)
    {

        switch (eventType)
        {
        case INSERT:

            onInsert(log);
            break;

        case UPDATE:
            onUpdate(log);
            break;

        case DELETE:
            onDelete(log);
            break;

        default:

            throw new KunderaException("Invalid event type:" + eventType);
        }

    }
371378
public function setEventType($eventType)
    {
        $allowed_values = array('tcu_defense', 'ihub_defense', 'station_defense', 'station_freeport');
        if ((!in_array($eventType, $allowed_values))) {
            throw new \InvalidArgumentException("Invalid value for 'eventType', must be one of 'tcu_defense', 'ihub_defense', 'station_defense', 'station_freeport'");
        }
        $this->container['eventType'] = $eventType;

        return $this;
    }
1173511
function EventListener_register(types) { // @arg EventTypeStringArray - ["type", ...]
                                         // @ret this
                                         // @desc register types
//{@dev
    $valid($type(types, "Array"), EventListener_register, "types");
//}@dev

//{@dev
    var that = this;

    // avoid duplicate
    types.forEach(function(type) {
        if (that._types.indexOf(type) < 0) {
            that._types.push(type);
        }
    });
//}@dev
    return this;
}
179986
public void register(EventDefinition eventDefinition, IEventListener listener) {
        if (eventDefinition.getType() == EventDefinition.TYPE_POST) {
            register(listenersPost, eventDefinition, listener, true);
        } else {
            register(listeners, eventDefinition, listener, false);
        }
    }
96311
protected function sortHandlers(string $eventType): void
    {
        $this->sorted[$eventType] = [];
        if (isset($this->handlers[$eventType])) {
            krsort($this->handlers[$eventType]);
            $this->sorted[$eventType] = call_user_func_array(
                'array_merge',
                $this->handlers[$eventType]
            );
        }
    }
20503
function trigger(eventType, ...args) {

    let event = new Event(event);
    args.length ? event[eventType] = args : null;
    this.dispatchEvent(event);
}
820838
public static function check($class, $eventType) 
  {
    $class = preg_replace("/Catapult\\\/", "", get_class($class));

    /** does the event exist ? **/
    if (array_key_exists($class, self::$events)) {

      if (in_array($eventType, self::$events[$class])) {
        return true;
      }
    }

    return false;
  }
1002592
function addHookByType(ctx, type, methodNames, fn) {
  let i = methodNames.length;

  // If no hook specified, add wildcard
  if (i === 0) {
    methodNames = ['*'];
    i = 1;
  }

  let hookType = `${type}Hooks`;

  if (!ctx[hookType]) ctx[hookType] = {};

  while (i--) {
    let methodName = methodNames[i];
    // for array method names
    if (Array.isArray(methodName)) {
      addHookByType(ctx, type, methodName, fn);
    } else {
      if (!ctx[hookType][methodName]) {
        ctx[hookType][methodName] = [fn];
      } else {
        ctx[hookType][methodName].push(fn);
      }
    }
  }
}
113536
private static function getModelClassFromEventType($type)
    {
        return self::isKnownEntityType($type)
            ? self::$eventTypeToModelClassMap[$type]
            : self::DEFAULT_EVENT_MODEL_CLASS;
    }
1035368
function (id, type, elem) {
            var self = this;
            $.each(elem.options.eventHandlers, function (event) {
                if (self.customEventHandlers[event] === undefined) self.customEventHandlers[event] = {};
                if (self.customEventHandlers[event][type] === undefined) self.customEventHandlers[event][type] = {};
                self.customEventHandlers[event][type][id] = elem;
            });
        }
610241
void triggerBasicEvent(Event.EventType type, String message)
  {
    triggerBasicEvent(type, message, false);
  }
1007293
function(eventType) {
    var copy;
    if (typeof eventType === "string" && eventType) {
      copy = _deepCopy(_handlers[eventType]) || null;
    } else {
      copy = _deepCopy(_handlers);
    }
    return copy;
  }
385533
public function registerCallback(EventCallbackInterface $callback)
    {
        if (!in_array($callback, $this->callbacks)) {
            $this->callbacks[] = $callback;
        }
    }
17971
public function dispatch($eventName, array $context = array())
    {
        return $this->getEventDispatcher()->dispatch(
            $eventName,
            new GenericEvent($this, $context)
        );
    }