Выполняет все события, что были помещены в именованный стек.

@param string $event_type   По умолчанию: 'before_request', 'after_request'
@param array  ...$arguments
435547
public function fire($event_type, ...$arguments)
    {
        $event_type = (string) $event_type;

        if (isset($this->callbacks[$event_type])) {
            foreach ($this->callbacks[$event_type] as &$callback) {
                $callback(...$arguments);
            }
        }
    }
414300
public function onRequestBeforeSend(Event $event)
    {
        $request = $event['request'];
        $timestamp = $this->getTimestamp($event);

        $url = $request->getUrl(true);
        $url->getQuery()->add('ts', $timestamp);

        $body = '';
        $path = sprintf('%s?%s', $url->getPath(), (string) $url->getQuery());

        if ($request instanceof EntityEnclosingRequest) {
            $body = $request->getBody();
        }

        $signature = $this->signer->getSignature($request->getMethod(), $path, $body);

        $request->setUrl($url);
        $request->setHeader('Content-Type', 'application/json');
        $request->setHeader('X-Leetchi-Signature', $signature);
    }
49616
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
        if ("RECALC".equals(EVENT_TYPE)) {
            range     = gauge.getRange();
            angleStep = ANGLE_RANGE / range;
            minValue  = gauge.getMinValue();
            sections  = gauge.getSections();
            resize();
            redraw();
            setBar(gauge.getCurrentValue());
        } else if ("VISIBILITY".equals(EVENT_TYPE)) {
            Helper.enableNode(valueText, gauge.isValueVisible());
            Helper.enableNode(titleText, !gauge.getTitle().isEmpty());
            Helper.enableNode(unitText, !gauge.getUnit().isEmpty());
            boolean tickLabelsVisible = gauge.getTickLabelsVisible();
            Helper.enableNode(minText, tickLabelsVisible);
            Helper.enableNode(maxText, tickLabelsVisible);
            boolean thresholdVisible = gauge.isThresholdVisible();
            Helper.enableNode(threshold, thresholdVisible);
            Helper.enableNode(thresholdText, thresholdVisible);
            resize();
            redraw();
        }
    }
1360013
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);

        if ("RECALC".equals(EVENT_TYPE)) {
            minValue  = tile.getMinValue();
            range     = tile.getRange();
            angleStep = ANGLE_RANGE / range;
            sections  = tile.getSections();
            redraw();
            setBar(tile.getCurrentValue());
        } else if ("VISIBILITY".equals(EVENT_TYPE)) {
            enableNode(titleText, !tile.getTitle().isEmpty());
            enableNode(text, tile.isTextVisible());
            enableNode(unitText, !tile.getUnit().isEmpty());
            enableNode(valueText, tile.isValueVisible());
        }
    }
921565
public function afterPaginate(Event $event)
    {
        $event;
        if (!$this->_table()->behaviors()->has('Search')) {
            return;
        }

        $enabled = $this->getConfig('enabled') ?: !$this->_request()->is('api');
        if (!$enabled) {
            return;
        }

        $fields = $this->fields();
        $this->_controller()->set('searchInputs', $fields);
    }
339088
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
        if ("RECALC".equals(EVENT_TYPE)) {
            range     = gauge.getRange();
            angleStep = -ANGLE_RANGE / range;
            redraw();
        } else if ("VISIBILITY".equals(EVENT_TYPE)) {
            Helper.enableNode(titleText, !gauge.getTitle().isEmpty());
        }
    }
1120054
public function postLoad(EventArgs $eventArgs)
    {
        if (method_exists($eventArgs, 'getEntity')) {
            $this->_triggerEvent(Events::postLoad, $eventArgs->getEntity(), $eventArgs);
        }
    }
922591
public function beforeFilter(Event $event)
    {
        $slug = lcfirst($this->request->params['type']);

        $this->type = $this->PostTypes->getOption($slug);

        if (!$this->type) {
            throw new Exception("The PostType is not registered");
        }

        $this->Model = TableRegistry::get($this->type['model']);

        // making the current item active
        $this->Menu->active($this->type['alias']);

        parent::beforeFilter($event);
    }
263997
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
        if ("RECALC".equals(EVENT_TYPE)) {
            angleRange        = Helper.clamp(90.0, 180.0, gauge.getAngleRange());
            minValue          = gauge.getMinValue();
            threshold         = gauge.getThreshold();
            range             = gauge.getRange();
            angleStep         = angleRange / range;
            highlightSections = gauge.isHighlightSections();
            redraw();
            rotateNeedle(gauge.getCurrentValue());
        } else if ("VISIBILITY".equals(EVENT_TYPE)) {
            enableNode(titleText, !gauge.getTitle().isEmpty());
            enableNode(valueText, gauge.isValueVisible());
            enableNode(sectionPane, gauge.getSectionsVisible());
            enableNode(thresholdRect, gauge.isThresholdVisible());
            enableNode(thresholdText, gauge.isThresholdVisible());
            enableNode(unitText, !gauge.getUnit().isEmpty());
            sectionsVisible = gauge.getSectionsVisible();
        } else if ("SECTION".equals(EVENT_TYPE)) {
            sections = gauge.getSections();
            sectionMap.clear();
            for(Section section : sections) { sectionMap.put(section, new Arc()); }
        } else if ("ALERT".equals(EVENT_TYPE)) {
            enableNode(valueText, gauge.isValueVisible() && !gauge.isAlert());
            enableNode(unitText, gauge.isValueVisible() && !gauge.isAlert());
            enableNode(alertIcon, gauge.isAlert());
            alertTooltip.setText(gauge.getAlertMessage());
        }
    }
1174485
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
        if ("RECALC".equals(EVENT_TYPE)) {
            minValue  = gauge.getMinValue();
            maxValue  = gauge.getMaxValue();
            range     = gauge.getRange();
            angleStep = ANGLE_RANGE / range;
            redraw();
            setBar(gauge.getCurrentValue());
        } else if ("SECTIONS".equals(EVENT_TYPE)) {
            sections         = gauge.getSections();
        } else if ("VISIBILITY".equals(EVENT_TYPE)) {
            sectionsVisible  = gauge.getSectionsVisible();
            thresholdVisible = gauge.isThresholdVisible();
            thresholdVisible = gauge.isThresholdVisible();
        }
    }
1360623
public function delete($_type = null, $id = null)
    {
        // setting up an event for the delete
        $_event = new Event('Controller.PostTypes.beforeDelete.' . $this->_type, $this, [
            'id' => $id,
        ]);
        $this->eventManager()->dispatch($_event);

        $postType = $this->Model->get($id);
        
        $this->request->allowMethod(['post', 'delete']);
        
        if ($this->Model->delete($postType)) {
            // setting up an event for the delete
            $_event = new Event('Controller.PostTypes.afterDelete.' . $this->_type, $this, [
                'id' => $id,
            ]);
            $this->eventManager()->dispatch($_event);
            
            $this->Flash->success(__('The {0} has been deleted.', [$this->Settings['type']]));
            
            return $this->redirect(['action' => 'index', 'type' => $this->_type]);
        } else {
            $this->Flash->error(__('The {0} could not be deleted. Please, try again.', [$this->Settings['type']]));
            return $this->redirect(['action' => 'index', 'type' => $this->_type]);
        }
    }
887199
protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
         if ("FINISHED".equals(EVENT_TYPE)) {
            if ( gauge.isHighlightSections() ) {
                redraw();
            }
        } else if ("ANGLE".equals(EVENT_TYPE)) {
            double currentValue = (needleRotate.getAngle() + START_ANGLE - 180) / angleStep + gauge.getMinValue();
            lcdText.setText((String.format(locale, formatString, currentValue)));
            if (gauge.isLcdVisible()) {
                lcdText.setAlignment(Pos.CENTER_RIGHT);
                lcdText.setTranslateX((width - lcdText.getPrefWidth()) * 0.5);
            } else {
                lcdText.setAlignment(Pos.CENTER);
                lcdText.setTranslateX((width - lcdText.getLayoutBounds().getWidth()) * 0.5);
            }
        } else if ("VISIBILITY".equals(EVENT_TYPE)) {
            enableNode(ledCanvas, gauge.isLedVisible());
            enableNode(titleText, !gauge.getTitle().isEmpty());
            enableNode(unitText, !gauge.getUnit().isEmpty());
            enableNode(lcd,gauge.isLcdVisible());
            enableNode(lcdText,gauge.isValueVisible());
            enableNode(threshold, gauge.isThresholdVisible());
            enableNode(average, gauge.isAverageVisible());
            boolean markersVisible = gauge.getMarkersVisible();
            for (Shape shape : markerMap.values()) { Helper.enableNode(shape, markersVisible); }
            resize();
            redraw();
        } else if ("LED".equals(EVENT_TYPE)) {
            if (gauge.isLedVisible()) { drawLed(led); }
        } else if ("LCD".equals(EVENT_TYPE)) {
            if (gauge.isLcdVisible()) redraw();
        } else if ("RECALC".equals(EVENT_TYPE)) {
            angleStep = gauge.getAngleStep();
            if (gauge.getValue() < gauge.getMinValue()) {
                oldValue = gauge.getMinValue();
            }
            if (gauge.getValue() > gauge.getMaxValue()) {
                oldValue = gauge.getMaxValue();
            }
            redraw();
            rotateNeedle();
        }
    }
753786
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);

        if ("VISIBILITY".equals(EVENT_TYPE)) {
            Helper.enableNode(titleText, !tile.getTitle().isEmpty());
            Helper.enableNode(text, tile.isTextVisible());
        } else if ("RECALC".equals(EVENT_TYPE)) {
            matrix.setColsAndRows(tile.getMatrixSize());
            resize();
        }
    }
1156234
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
        if ("VISIBILITY".equals(EVENT_TYPE)) {

        } else if ("SECTION".equals(EVENT_TYPE)) {
            redraw();
        }
    }
103908
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
        if ("FINISHED".equals(EVENT_TYPE)) {
            double currentValue = gauge.getCurrentValue();
            // eu.hansolo.medusa.Check sections for value and fire section events
            if (gauge.getCheckSectionsForValue()) {
                int listSize = sections.size();
                for (int i = 0 ; i < listSize ; i++) { sections.get(i).checkForValue(currentValue); }
            }

            // eu.hansolo.medusa.Check areas for value and fire section events
            if (gauge.getCheckAreasForValue()) {
                int listSize = areas.size();
                for (int i = 0 ; i < listSize ; i++) { areas.get(i).checkForValue(currentValue); }
            }

            // Highlight Sections and/or Areas if enabled
            if (highlightSections | highlightAreas) {
                sectionsAndAreasCtx.clearRect(0, 0, size, size);
                drawAreasAndSections(sectionsAndAreasCtx);
            }
        } else if ("VISIBILITY".equals(EVENT_TYPE)) {
            Helper.enableNode(ledCanvas, gauge.isLedVisible());
            Helper.enableNode(titleText, !gauge.getTitle().isEmpty());
            Helper.enableNode(subTitleText, !gauge.getSubTitle().isEmpty());
            Helper.enableNode(unitText, !gauge.getUnit().isEmpty());
            Helper.enableNode(valueText, gauge.isValueVisible());
            Helper.enableNode(lcd, gauge.isLcdVisible() && gauge.isValueVisible());
            Helper.enableNode(knobCanvas, gauge.isKnobVisible());
            Helper.enableNode(threshold, gauge.isThresholdVisible());
            Helper.enableNode(average, gauge.isAverageVisible());
            sectionsVisible = gauge.getSectionsVisible();
            areasVisible    = gauge.getAreasVisible();
            boolean markersVisible = gauge.getMarkersVisible();
            for (Shape shape : markerMap.values()) { Helper.enableNode(shape, markersVisible); }
            resize();
            redraw();
        } else if ("LED".equals(EVENT_TYPE)) {
            if (gauge.isLedVisible()) { drawLed(); }
        } else if ("LCD".equals(EVENT_TYPE)) {
            if (gauge.isLcdVisible()) redraw();
        } else if ("RECALC".equals(EVENT_TYPE)) {
            startAngle = gauge.getStartAngle();
            angleRange = gauge.getAngleRange();
            angleStep  = gauge.getAngleStep();
            minValue   = gauge.getMinValue();
            maxValue   = gauge.getMaxValue();
            if (gauge.getValue() < minValue) { oldValue = minValue; }
            if (gauge.getValue() > maxValue) { oldValue = maxValue; }
            resize();
            redraw();
            rotateNeedle(gauge.getCurrentValue());
        } else if ("SECTION".equals(EVENT_TYPE)) {
            sections          = gauge.getSections();
            highlightSections = gauge.isHighlightSections();
            sectionsVisible   = gauge.getSectionsVisible();
            areas             = gauge.getAreas();
            highlightAreas    = gauge.isHighlightAreas();
            areasVisible      = gauge.getAreasVisible();
            resize();
            redraw();
        } else if ("INTERACTIVITY".equals(EVENT_TYPE)) {
            if (gauge.isInteractive()) {
                knobCanvas.setOnMousePressed(mouseHandler);
                knobCanvas.setOnMouseReleased(mouseHandler);
                if (!gauge.getButtonTooltipText().isEmpty()) {
                    buttonTooltip.setText(gauge.getButtonTooltipText());
                    Tooltip.install(knobCanvas, buttonTooltip);
                }
            } else {
                knobCanvas.removeEventHandler(MouseEvent.MOUSE_PRESSED, mouseHandler);
                knobCanvas.removeEventHandler(MouseEvent.MOUSE_RELEASED, mouseHandler);
                Tooltip.uninstall(knobCanvas, buttonTooltip);
            }
        }
    }
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;
}
1248461
public function addEvent($event, $eventParams)
    {
        // check if valid rule usage for object_type_id
        $this->validateRule("Events", $event);
        // get required parameters for specific rule
        $requiredParams = Events::GetRequiredParams($event);
        // checking for missing and invalid types for each parameter
        $check_params = $this->_checkParams($requiredParams, $eventParams);
        // if no missing or invalid rule parameters
        if ($check_params)
        {
            $value = $this->_formatParams($eventParams);
            $rule = $event . "(" . $value . ")";
            $this->_events[] = $rule;

            return $this->_events;
        }
        return false;
    }