Commit | Line | Data |
---|---|---|
132ec342 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
41498ac5 | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
132ec342 | 5 | | | |
41498ac5 TO |
6 | | This work is published under the GNU AGPLv3 license with some | |
7 | | permitted exceptions and without any warranty. For full license | | |
8 | | and copyright information, see https://civicrm.org/licensing | | |
132ec342 | 9 | +--------------------------------------------------------------------+ |
d25dd0ee | 10 | */ |
132ec342 TO |
11 | |
12 | namespace Civi\API\Event; | |
13 | ||
6550386a EM |
14 | /** |
15 | * Class RespondEvent | |
16 | * @package Civi\API\Event | |
17 | */ | |
132ec342 TO |
18 | class RespondEvent extends Event { |
19 | /** | |
20 | * @var mixed | |
21 | */ | |
22 | private $response; | |
23 | ||
6550386a | 24 | /** |
8882ff5c TO |
25 | * @param \Civi\API\Provider\ProviderInterface $apiProvider |
26 | * The API provider responsible for executing the request. | |
27 | * @param array $apiRequest | |
28 | * The full description of the API request. | |
29 | * @param mixed $response | |
30 | * The response to return to the client. | |
c98e9ee3 TO |
31 | * @param \Civi\API\Kernel $apiKernel |
32 | * The kernel which fired the event. | |
6550386a | 33 | */ |
c98e9ee3 | 34 | public function __construct($apiProvider, $apiRequest, $response, $apiKernel) { |
132ec342 | 35 | $this->response = $response; |
c98e9ee3 | 36 | parent::__construct($apiProvider, $apiRequest, $apiKernel); |
132ec342 TO |
37 | } |
38 | ||
39 | /** | |
40 | * @return mixed | |
41 | */ | |
42 | public function getResponse() { | |
43 | return $this->response; | |
44 | } | |
45 | ||
46 | /** | |
47 | * @param mixed $response | |
8882ff5c | 48 | * The response to return to the client. |
132ec342 TO |
49 | */ |
50 | public function setResponse($response) { | |
51 | $this->response = $response; | |
52 | } | |
96025800 | 53 | |
132ec342 | 54 | } |