You are here

class GetResponseEvent in Zircon Profile 8

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

Allows to create a response for a request.

Call setResponse() to set the response that will be returned for the current request. The propagation of this event is stopped as soon as a response is set.

@author Bernhard Schussek <bschussek@gmail.com>

Hierarchy

Expanded class hierarchy of GetResponseEvent

30 files declare their use of GetResponseEvent
AddRequestFormatsListener.php in vendor/symfony/http-kernel/EventListener/AddRequestFormatsListener.php
AjaxResponseSubscriber.php in core/lib/Drupal/Core/EventSubscriber/AjaxResponseSubscriber.php
Contains \Drupal\Core\EventSubscriber\AjaxResponseSubscriber.
AuthenticationSubscriber.php in core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php
Contains \Drupal\Core\EventSubscriber\AuthenticationSubscriber.
ContentControllerSubscriber.php in core/lib/Drupal/Core/EventSubscriber/ContentControllerSubscriber.php
Contains \Drupal\Core\EventSubscriber\ContentControllerSubscriber.
DynamicPageCacheSubscriber.php in core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php
Contains \Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber.

... See full list

File

vendor/symfony/http-kernel/Event/GetResponseEvent.php, line 25

Namespace

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

  /**
   * The response object.
   *
   * @var Response
   */
  private $response;

  /**
   * Returns the response object.
   *
   * @return Response
   */
  public function getResponse() {
    return $this->response;
  }

  /**
   * Sets a response and stops event propagation.
   *
   * @param Response $response
   */
  public function setResponse(Response $response) {
    $this->response = $response;
    $this
      ->stopPropagation();
  }

  /**
   * Returns whether a response was set.
   *
   * @return bool Whether a response was set
   */
  public function hasResponse() {
    return null !== $this->response;
  }

}

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.
GetResponseEvent::$response private property The response object.
GetResponseEvent::getResponse public function Returns the response object.
GetResponseEvent::hasResponse public function Returns whether a response was set.
GetResponseEvent::setResponse public function Sets a response and stops event propagation.
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