class KernelEvent

Base class for events thrown in the HttpKernel component

@author Bernhard Schussek <bschussek@gmail.com>

@api

Hierarchy

  • class \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of KernelEvent

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/KernelEvent.php, line 25

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 integer
   */
  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
   *
   * @api
   */
  public function getKernel() {
    return $this->kernel;
  }

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

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

}

Members

Namesort descending Modifiers Type Description Overrides
Event::$dispatcher private property
Event::$name private property
Event::$propagationStopped private property
Event::getDispatcher public function Returns the EventDispatcher that dispatches this Event
Event::getName public function Gets the event's name.
Event::isPropagationStopped public function Returns whether further event listeners should be triggered.
Event::setDispatcher public function Stores the EventDispatcher that dispatches this Event
Event::setName 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::__construct public function 4