setProcessed example

// Save this context in the proxy         $proxy = $this->args->getSubject();
        $proxy->__pushHookExecutionContext($this->args->getMethod()$this);

        // Before hooks         $this->hookManager->getEventManager()->notify(
            $this->getHookEventName(Enlight_Hook_HookHandler::TypeBefore),
            $this->args
        );

        // Replace hooks and/or original method         $this->args->setProcessed(false);
        $returnValue = $this->executeReplaceChain($this->args->getArgs());
        $this->args->setReturn($returnValue);
        $this->args->setProcessed(true);

        // After hooks         $returnValue = $this->hookManager->getEventManager()->filter(
            $this->getHookEventName(Enlight_Hook_HookHandler::TypeAfter),
            $this->args->getReturn(),
            $this->args
        );

        

    public function onNotifyAction(Enlight_Event_EventArgs $args)
    {
        $args->setProcessed(true);

        /** @var Enlight_Controller_Action $action */
        $action = $args->getSubject();

        $id = (int) $action->Request()->getParam('sArticle');
        $email = $action->Request()->getParam('sNotificationEmail');

        $sError = false;
        $action->View()->assign('NotifyEmailError', false);
        $notifyOrderNumber = $action->Request()->getParam('notifyOrdernumber');
        $connection = $this->get(Connection::class);

        

    public function notify($event$eventArgs = null)
    {
        if (!$this->hasListeners($event)) {
            return null;
        }

        $eventArgs = $this->buildEventArgs($eventArgs);
        $eventArgs->setReturn(null);
        $eventArgs->setName($event);
        $eventArgs->setProcessed(false);

        foreach ($this->getListeners($event) as $listener) {
            $listener->execute($eventArgs);
        }
        $eventArgs->setProcessed(true);

        return $eventArgs;
    }

    /** * Checks if the event has registered listeners. * If the event has listeners this listeners will be executed with the given event arguments. * The event arguments have to been an array or an instance of the Enlight_Event_EventArgs class. * If the given arguments not an array or an instance of the Enlight_Event_EventArgs class enlight * throw an Enlight_Event_Exception. * Before the listener will be executed the the flag "processed" will be set to false in the event arguments. * After all event listeners has been executed the "processed" flag will be set to true. * * The event listeners will be executed until one of the listeners return not null. * * @param string $event * @param Enlight_Event_EventArgs|array|null $eventArgs * * @throws Enlight_Exception * * @return Enlight_Event_EventArgs|null */
Home | Imprint | This part of the site doesn't use cookies.