You are here

class KernelEvent in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/Event/KernelEvent.php \Symfony\Component\HttpKernel\Event\KernelEvent

Base class for events thrown in the HttpKernel component.

@author Bernhard Schussek <bschussek@gmail.com>

Hierarchy

  • class \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of KernelEvent

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

File

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

Namespace

Symfony\Component\HttpKernel\Event
View source
class KernelEvent extends Event {

  /**
   * The kernel in which this event was thrown.
   *
   * @var HttpKernelInterface
   */
  private $kernel;

  /**
   * The request the kernel is currently processing.
   *
   * @var Request
   */
  private $request;

  /**
   * The request type the kernel is currently processing.  One of
   * HttpKernelInterface::MASTER_REQUEST and HttpKernelInterface::SUB_REQUEST.
   *
   * @var int
   */
  private $requestType;
  public function __construct(HttpKernelInterface $kernel, Request $request, $requestType) {
    $this->kernel = $kernel;
    $this->request = $request;
    $this->requestType = $requestType;
  }

  /**
   * Returns the kernel in which this event was thrown.
   *
   * @return HttpKernelInterface
   */
  public function getKernel() {
    return $this->kernel;
  }

  /**
   * Returns the request the kernel is currently processing.
   *
   * @return Request
   */
  public function getRequest() {
    return $this->request;
  }

  /**
   * Returns the request type the kernel is currently processing.
   *
   * @return int One of HttpKernelInterface::MASTER_REQUEST and
   *             HttpKernelInterface::SUB_REQUEST
   */
  public function getRequestType() {
    return $this->requestType;
  }

  /**
   * Checks if this is a master request.
   *
   * @return bool True if the request is a master request
   */
  public function isMasterRequest() {
    return HttpKernelInterface::MASTER_REQUEST === $this->requestType;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Event::$dispatcher private property
Event::$name private property
Event::$propagationStopped private property
Event::getDispatcher Deprecated public function Returns the EventDispatcher that dispatches this Event.
Event::getName Deprecated public function Gets the event's name.
Event::isPropagationStopped public function Returns whether further event listeners should be triggered.
Event::setDispatcher Deprecated public function Stores the EventDispatcher that dispatches this Event.
Event::setName Deprecated public function Sets the event's name property.
Event::stopPropagation public function Stops the propagation of the event to further event listeners.
KernelEvent::$kernel private property The kernel in which this event was thrown.
KernelEvent::$request private property The request the kernel is currently processing.
KernelEvent::$requestType private property The request type the kernel is currently processing. One of HttpKernelInterface::MASTER_REQUEST and HttpKernelInterface::SUB_REQUEST.
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::isMasterRequest public function Checks if this is a master request.
KernelEvent::__construct public function 4