Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. KernelEvent.php

class KernelEvent

Base class for events dispatched in the HttpKernel component.

@author Bernhard Schussek <bschussek@gmail.com>

Hierarchy

  • class \Symfony\Contracts\EventDispatcher\Event implements \Psr\EventDispatcher\StoppableEventInterface
    • class \Symfony\Component\HttpKernel\Event\KernelEvent extends \Symfony\Contracts\EventDispatcher\Event

Expanded class hierarchy of KernelEvent

3 files declare their use of KernelEvent
DebugHandlersListener.php in vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php
LocaleListener.php in vendor/symfony/http-kernel/EventListener/LocaleListener.php
RoutePreloader.php in core/lib/Drupal/Core/Routing/RoutePreloader.php

File

vendor/symfony/http-kernel/Event/KernelEvent.php, line 23

Namespace

Symfony\Component\HttpKernel\Event
View source
class KernelEvent extends Event {
    
    /**
     * @param int $requestType The request type the kernel is currently processing; one of
     *                         HttpKernelInterface::MAIN_REQUEST or HttpKernelInterface::SUB_REQUEST
     */
    public function __construct(HttpKernelInterface $kernel, Request $request, ?int $requestType) {
    }
    
    /**
     * Returns the kernel in which this event was thrown.
     */
    public function getKernel() : HttpKernelInterface {
        return $this->kernel;
    }
    
    /**
     * Returns the request the kernel is currently processing.
     */
    public function getRequest() : Request {
        return $this->request;
    }
    
    /**
     * Returns the request type the kernel is currently processing.
     *
     * @return int One of HttpKernelInterface::MAIN_REQUEST and
     *             HttpKernelInterface::SUB_REQUEST
     */
    public function getRequestType() : int {
        return $this->requestType;
    }
    
    /**
     * Checks if this is the main request.
     */
    public function isMainRequest() : bool {
        return HttpKernelInterface::MAIN_REQUEST === $this->requestType;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
Event::$propagationStopped private property
Event::isPropagationStopped public function Is propagation stopped? Overrides StoppableEventInterface::isPropagationStopped
Event::stopPropagation public function Stops the propagation of the event to further event listeners. 1
KernelEvent::getKernel public function Returns the kernel in which this event was thrown.
KernelEvent::getRequest public function Returns the request the kernel is currently processing.
KernelEvent::getRequestType public function Returns the request type the kernel is currently processing.
KernelEvent::isMainRequest public function Checks if this is the main request.
KernelEvent::__construct public function 6

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal