4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\HttpKernel\Event;
14 use Symfony\Component\HttpKernel\HttpKernelInterface;
15 use Symfony\Component\HttpFoundation\Request;
16 use Symfony\Component\HttpFoundation\Response;
19 * Allows to filter a Response object.
21 * You can call getResponse() to retrieve the current response. With
22 * setResponse() you can set a new response that will be returned to the
25 * @author Bernhard Schussek <bschussek@gmail.com>
27 class FilterResponseEvent extends KernelEvent
30 * The current response object.
36 public function __construct(HttpKernelInterface $kernel, Request $request, $requestType, Response $response)
38 parent::__construct($kernel, $request, $requestType);
40 $this->setResponse($response);
44 * Returns the current response object.
48 public function getResponse()
50 return $this->response;
54 * Sets a new response object.
56 * @param Response $response
58 public function setResponse(Response $response)
60 $this->response = $response;