UNPKG

woltlab-compiler

Version:

A compiler for WoltLab-Package Archives and WoltLab-Package Components

57 lines 2.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const util_1 = require("util"); const Listener_1 = require("./Listener"); /** * Represents the declaration of a PHP-class that should be executed when a specific event occurs. * * Please note that you have to provide your PHP-files using a `FilesInstruction`. */ class EventListener extends Listener_1.Listener { /** * Initializes a new instance of the `EventListener` class. */ constructor(options) { super(options); /** * A value indicating whether listening to the event thrown by a class inheriting from `className` is allowed. */ this.allowInherited = false; this.ClassName = options.ClassName; if (!util_1.isNullOrUndefined(options.AllowInherited)) { this.AllowInherited = options.AllowInherited; } this.EventHandlerClassName = options.EventHandlerClassName; } /** * Gets or sets the name of the class to listen to. */ get ClassName() { return this.className; } set ClassName(value) { this.className = value; } /** * Gets or sets a value indicating whether listening to the event thrown by a class inheriting from `className` is allowed. */ get AllowInherited() { return this.allowInherited; } set AllowInherited(value) { this.allowInherited = value; } /** * Gets or sets the name of the event-handler class which is triggered when the event has been executed. * * Please consider that the event-handler class **must** inherit the `wcf\system\event\listener\IParameterizedEventListener`-class. */ get EventHandlerClassName() { return this.eventHandlerClassName; } set EventHandlerClassName(value) { this.eventHandlerClassName = value; } } exports.EventListener = EventListener; //# sourceMappingURL=EventListener.js.map