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>
@api
Expanded class hierarchy of GetResponseEvent
class GetResponseEvent extends KernelEvent {
/**
* The response object
* @var Symfony\Component\HttpFoundation\Response
*/
private $response;
/**
* Returns the response object
*
* @return Symfony\Component\HttpFoundation\Response
*
* @api
*/
public function getResponse() {
return $this->response;
}
/**
* Sets a response and stops event propagation
*
* @param Symfony\Component\HttpFoundation\Response $response
*
* @api
*/
public function setResponse(Response $response) {
$this->response = $response;
$this
->stopPropagation();
}
/**
* Returns whether a response was set
*
* @return Boolean Whether a response was set
*
* @api
*/
public function hasResponse() {
return null !== $this->response;
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Event:: |
private | property | ||
Event:: |
private | property | ||
Event:: |
private | property | ||
Event:: |
public | function | Returns the EventDispatcher that dispatches this Event | |
Event:: |
public | function | Gets the event's name. | |
Event:: |
public | function | Returns whether further event listeners should be triggered. | |
Event:: |
public | function | Stores the EventDispatcher that dispatches this Event | |
Event:: |
public | function | Sets the event's name property. | |
Event:: |
public | function | Stops the propagation of the event to further event listeners. | |
GetResponseEvent:: |
private | property | The response object | |
GetResponseEvent:: |
public | function | Returns the response object | |
GetResponseEvent:: |
public | function | Returns whether a response was set | |
GetResponseEvent:: |
public | function | Sets a response and stops event propagation | |
KernelEvent:: |
private | property | The kernel in which this event was thrown | |
KernelEvent:: |
private | property | The request the kernel is currently processing | |
KernelEvent:: |
private | property | The request type the kernel is currently processing. One of HttpKernelInterface::MASTER_REQUEST and HttpKernelInterface::SUB_REQUEST | |
KernelEvent:: |
public | function | Returns the kernel in which this event was thrown | |
KernelEvent:: |
public | function | Returns the request the kernel is currently processing | |
KernelEvent:: |
public | function | Returns the request type the kernel is currently processing | |
KernelEvent:: |
public | function | 4 |