You are here

class GetResponseForControllerResultEvent in Zircon Profile 8

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

Allows to create a response for the return value of a controller.

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 GetResponseForControllerResultEvent

6 files declare their use of GetResponseForControllerResultEvent
AcceptNegotiation406.php in core/lib/Drupal/Core/EventSubscriber/AcceptNegotiation406.php
Contains \Drupal\Core\EventSubscriber\AcceptNegotiation406.
FormAjaxSubscriber.php in core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php
Contains \Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber.
HttpKernel.php in vendor/symfony/http-kernel/HttpKernel.php
MainContentViewSubscriber.php in core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php
Contains \Drupal\Core\EventSubscriber\MainContentViewSubscriber.
PsrResponseSubscriber.php in core/lib/Drupal/Core/EventSubscriber/PsrResponseSubscriber.php
Contains \Drupal\Core\EventSubscriber\PsrResponseSubscriber.

... See full list

File

vendor/symfony/http-kernel/Event/GetResponseForControllerResultEvent.php, line 26

Namespace

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

  /**
   * The return value of the controller.
   *
   * @var mixed
   */
  private $controllerResult;
  public function __construct(HttpKernelInterface $kernel, Request $request, $requestType, $controllerResult) {
    parent::__construct($kernel, $request, $requestType);
    $this->controllerResult = $controllerResult;
  }

  /**
   * Returns the return value of the controller.
   *
   * @return mixed The controller return value
   */
  public function getControllerResult() {
    return $this->controllerResult;
  }

  /**
   * Assigns the return value of the controller.
   *
   * @param mixed $controllerResult The controller return value
   */
  public function setControllerResult($controllerResult) {
    $this->controllerResult = $controllerResult;
  }

}

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.
GetResponseForControllerResultEvent::$controllerResult private property The return value of the controller.
GetResponseForControllerResultEvent::getControllerResult public function Returns the return value of the controller.
GetResponseForControllerResultEvent::setControllerResult public function Assigns the return value of the controller.
GetResponseForControllerResultEvent::__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.