Handle the event.

@param $event

@return void
544215
public function handle($event): void
    {
        $commentsService = app()->make('InetStudio\Comments\Contracts\Services\Back\CommentsServiceContract');

        $user = $event->user;

        $commentsService->getModel()::where([
            ['user_id', '=', 0],
            ['email', '=', $user->email],
        ])->update([
            'user_id' => $user->id,
            'name' => $user->name,
        ]);
    }
638580
public function handle($event)
    {
        if ($event instanceof CExceptionEvent)
            $this->logExceptionEvent($event);
        else
            $this->logErrorEvent($event);
        parent::handle($event);
    }
70123
public function has_events($event)
	{
		if (isset($this->_events[$event]) and count($this->_events[$event]) > 0)
		{
			return true;
		}
		return false;
	}
249959
public function handle(EventInterface $event)
    {

        try {
            // load the application server instance
            /** @var \AppserverIo\Psr\ApplicationServer\ApplicationServerInterface $applicationServer */
            $applicationServer = $this->getApplicationServer();

            // write a log message that the event has been invoked
            $applicationServer->getSystemLogger()->info($event->getName());

            // load the service instance and switch the umask
            /** @var \AppserverIo\Appserver\Core\Api\DeploymentService $service */
            $service = $applicationServer->newService('AppserverIo\Appserver\Core\Api\DeploymentService');
            $service->initUmask($applicationServer->getSystemConfiguration()->getUmask());

        } catch (\Exception $e) {
            $applicationServer->getSystemLogger()->error($e->__toString());
        }
    }
277623
protected function handleError($event)
    {
        if (error_reporting() & $event->code) {
            $this->getSentryClient()->captureException(
                $this->createErrorException($event->message, $event->code, $event->file, $event->line)
            );
        }
        parent::handleError($event);
    }
259188
public function handleRoutes($event)
    {
        $event->getRouter()

            // --------------------
            // | Attachment
            // --------------------
            ->prefix('/api/attachment')
            ->post('attachment-upload', '', UploadController::class)

            // --------------------
            // | Helpers
            // --------------------
            ->prefix('/api/helper')
            ->get('helper-pinyin', '/pinyin', PinyinController::class)

            // --------------------
            // | Permission
            // --------------------
            ->prefix('/api/permission')
            ->get('permission-list', '', PermissionListController::class)
            ->put('permission-update', '', PermissionUpdateController::class)

            // --------------------
            // | Config
            // --------------------
            ->prefix('/api/config')
            ->get('config-list', '', ConfigListController::class)
            ->put('config-update', '/{key}', ConfigUpdateController::class)
            ->post('config-logo', '/logo', LogoUpdateController::class)

            // --------------------
            // | Auth
            // --------------------
            ->prefix('/api/auth')
            ->get('auth-check', '', AuthCheckController::class)
            ->post('auth-login', '/login', LoginController::class)
            ->post('auth-logout', '/logout', LogoutController::class)
            ->post('auth-forget', '/forget', ForgetPasswordController::class)
            ->post('auth-reset', '/reset/{token}', ResetPasswordController::class)

            // --------------------
            // | Member
            // --------------------
            ->prefix('/api/member')
            ->get('member-list', '', MemberListController::class)
            ->post('member-create', '', MemberCreateController::class)
            ->get('member-item', '/{username}', MemberItemController::class)
            ->put('member-update', '/{username}', MemberUpdateController::class)
            ->put('member-role-update', '/{username}/role', MemberRoleUpdateController::class)

            // --------------------
            // | Role
            // --------------------
            ->prefix('/api/role')
            ->get('role-list', '', RoleListController::class)
            ->post('role-create', '', RoleCreateController::class)
            ->put('role-update', '/{id}', RoleUpdateController::class)
            ->delete('role-delete', '/{id}', RoleDeleteController::class)

            // --------------------
            // | Extension
            // --------------------
            ->prefix('/api/extension')
            ->get('extension-list', '', ExtensionListController::class)
            ->put('extension-activate', '/{vendor}/{package}', ExtensionActivateController::class)
            ->delete('extension-uninstall', '/{vendor}/{package}', ExtensionUninstallController::class)

            // set prefix back to empty
            ->prefix('');
    }
947632
public function handle(Event $event)
    {
        $name = $event->getName();
        list(, $method) = explode('.', $name);
        if (empty($this->_config['for']) && empty($this->_config['when'])) {
            return $this->{$method}($event);
        }
        if ($this->matches($event)) {
            return $this->{$method}($event);
        }
    }
328945
public function handle($event, $args) {
		if (isset($this->callback[$event])) {
			$this->callback[$event](...$args);
		}
	}
1017453
public function onAfterInitialise(Event $event): void
    {
        /** @var WebApplication $app */
        $app = $event['app'];

        // Remove index.php
        if ($app->uri->script === 'index.php') {
            $app->uri->script = null;
        }
    }
375158
public function add($event) {
        $event->setParent($this->_parent);
        $this->_events[$event->getName()] = $event;
    }
249656
public function handle(EventInterface $event)
    {

        try {
            // load the application server, naming directory and system configuration instance
            /** @var \AppserverIo\Psr\ApplicationServer\ApplicationServerInterface $applicationServer */
            $applicationServer = $this->getApplicationServer();
            /** @var \AppserverIo\Psr\Naming\NamingDirectoryInterface $namingDirectory */
            $namingDirectory = $applicationServer->getNamingDirectory();
            /** @var \AppserverIo\Psr\ApplicationServer\Configuration\SystemConfigurationInterface $systemConfiguration */
            $systemConfiguration = $applicationServer->getSystemConfiguration();

            // initialize the loggers
            $loggers = array();
            foreach ($systemConfiguration->getLoggers() as $loggerNode) {
                $loggers[$loggerNode->getName()] = LoggerFactory::factory($loggerNode);
            }

            // register the logger callbacks in the naming directory
            foreach ($loggers as $name => $logger) {
                $namingDirectory->bind(sprintf('php:global/log/%s', $name), $logger);
            }

            // set the initialized loggers finally
            $applicationServer->setLoggers($loggers);

        } catch (\Exception $e) {
            $applicationServer->getSystemLogger()->error($e->__toString());
        }
    }
621279
public function on(string $event, $handler)
    {
        if (self::isSupportedEvent($event)) {
            $this->options[$event] = $handler;
        }
    }
1305567
public function handle($event)
    {
        $needCrop = $event->dataType->rows()
            ->whereType('image')
            ->where('details', 'like', '%cropper%')
            ->exists();

        if ($needCrop) {
            $event->model->cropPhotos($event);
        }
    }
263858
public function handle(RegisteredEvent $event)
    {
        $this->track(Settings::TYPEID_REGISTERED, $event->user->id, 10);
    }
644417
public function handle(MemberCreated $event)
    {
        if (is_null($event->actor)) {
            return;
        }

        $data = [
            'ip' => request()->ip(),
            'ua' => request()->header('User-Agent'),
        ];

        $event->actor->log('member.create', $data);
    }
517647
public function handle(Event $event)
    {
        // Define Event:
        
        $this->setEvent($event);
        
        // Check Event Name:
        
        if (!$this->hasHandler($event->getName())) {
            
            throw new InvalidArgumentException(
                sprintf(
                    'An event handler does not exist for "%s"',
                    $event->getName()
                )
            );
            
        }
        
        // Handle Event:
        
        $this->{$this->handlers[$event->getName()]}();
    }
29038
public function transition($event): void
    {
        $this->apply($event, self::HANDLE_PREFIX);

        $this->version++;
    }