You are here

class FilterResponseEvent in Zircon Profile 8.0

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

Allows to filter a Response object.

You can call getResponse() to retrieve the current response. With setResponse() you can set a new response that will be returned to the browser.

@author Bernhard Schussek <bschussek@gmail.com>

Hierarchy

Expanded class hierarchy of FilterResponseEvent

30 files declare their use of FilterResponseEvent
ActiveLinkResponseFilter.php in core/lib/Drupal/Core/EventSubscriber/ActiveLinkResponseFilter.php
Contains \Drupal\Core\EventSubscriber\ActiveLinkResponseFilter.
AjaxResponseSubscriber.php in core/lib/Drupal/Core/EventSubscriber/AjaxResponseSubscriber.php
Contains \Drupal\Core\EventSubscriber\AjaxResponseSubscriber.
AjaxResponseTest.php in core/tests/Drupal/Tests/Core/Ajax/AjaxResponseTest.php
Contains \Drupal\Tests\Core\Ajax\AjaxResponseTest.
AnonymousUserResponseSubscriber.php in core/lib/Drupal/Core/EventSubscriber/AnonymousUserResponseSubscriber.php
Contains \Drupal\Core\EventSubscriber\AnonymousUserResponseSubscriber.
ClientErrorResponseSubscriber.php in core/lib/Drupal/Core/EventSubscriber/ClientErrorResponseSubscriber.php
Contains \Drupal\Core\EventSubscriber\ClientErrorResponseSubscriber.

... See full list

File

vendor/symfony/http-kernel/Event/FilterResponseEvent.php, line 27

Namespace

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

  /**
   * The current response object.
   *
   * @var Response
   */
  private $response;
  public function __construct(HttpKernelInterface $kernel, Request $request, $requestType, Response $response) {
    parent::__construct($kernel, $request, $requestType);
    $this
      ->setResponse($response);
  }

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

  /**
   * Sets a new response object.
   *
   * @param Response $response
   */
  public function setResponse(Response $response) {
    $this->response = $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.
FilterResponseEvent::$response private property The current response object.
FilterResponseEvent::getResponse public function Returns the current response object.
FilterResponseEvent::setResponse public function Sets a new response object.
FilterResponseEvent::__construct public function Overrides KernelEvent::__construct
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.