Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\HttpKernel\Event; Chris@0: Chris@17: use Symfony\Component\HttpFoundation\Request; Chris@0: use Symfony\Component\HttpKernel\HttpKernelInterface; Chris@0: Chris@0: /** Chris@0: * Allows to create a response for the return value of a controller. Chris@0: * Chris@0: * Call setResponse() to set the response that will be returned for the Chris@0: * current request. The propagation of this event is stopped as soon as a Chris@0: * response is set. Chris@0: * Chris@0: * @author Bernhard Schussek Chris@0: */ Chris@0: class GetResponseForControllerResultEvent extends GetResponseEvent Chris@0: { Chris@0: /** Chris@0: * The return value of the controller. Chris@0: * Chris@0: * @var mixed Chris@0: */ Chris@0: private $controllerResult; Chris@0: Chris@0: public function __construct(HttpKernelInterface $kernel, Request $request, $requestType, $controllerResult) Chris@0: { Chris@0: parent::__construct($kernel, $request, $requestType); Chris@0: Chris@0: $this->controllerResult = $controllerResult; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns the return value of the controller. Chris@0: * Chris@0: * @return mixed The controller return value Chris@0: */ Chris@0: public function getControllerResult() Chris@0: { Chris@0: return $this->controllerResult; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Assigns the return value of the controller. Chris@0: * Chris@0: * @param mixed $controllerResult The controller return value Chris@0: */ Chris@0: public function setControllerResult($controllerResult) Chris@0: { Chris@0: $this->controllerResult = $controllerResult; Chris@0: } Chris@0: }