Version 1
[yaffs-website] / vendor / symfony / http-kernel / Event / GetResponseForControllerResultEvent.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\HttpKernel\Event;
13
14 use Symfony\Component\HttpKernel\HttpKernelInterface;
15 use Symfony\Component\HttpFoundation\Request;
16
17 /**
18  * Allows to create a response for the return value of a controller.
19  *
20  * Call setResponse() to set the response that will be returned for the
21  * current request. The propagation of this event is stopped as soon as a
22  * response is set.
23  *
24  * @author Bernhard Schussek <bschussek@gmail.com>
25  */
26 class GetResponseForControllerResultEvent extends GetResponseEvent
27 {
28     /**
29      * The return value of the controller.
30      *
31      * @var mixed
32      */
33     private $controllerResult;
34
35     public function __construct(HttpKernelInterface $kernel, Request $request, $requestType, $controllerResult)
36     {
37         parent::__construct($kernel, $request, $requestType);
38
39         $this->controllerResult = $controllerResult;
40     }
41
42     /**
43      * Returns the return value of the controller.
44      *
45      * @return mixed The controller return value
46      */
47     public function getControllerResult()
48     {
49         return $this->controllerResult;
50     }
51
52     /**
53      * Assigns the return value of the controller.
54      *
55      * @param mixed $controllerResult The controller return value
56      */
57     public function setControllerResult($controllerResult)
58     {
59         $this->controllerResult = $controllerResult;
60     }
61 }