Merge pull request #15837 from totten/master-prtmpl
[civicrm-core.git] / Civi / API / Event / RespondEvent.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 |
9 +--------------------------------------------------------------------+
10 */
11
12 namespace Civi\API\Event;
13
14 /**
15 * Class RespondEvent
16 * @package Civi\API\Event
17 */
18 class RespondEvent extends Event {
19 /**
20 * @var mixed
21 */
22 private $response;
23
24 /**
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.
31 * @param \Civi\API\Kernel $apiKernel
32 * The kernel which fired the event.
33 */
34 public function __construct($apiProvider, $apiRequest, $response, $apiKernel) {
35 $this->response = $response;
36 parent::__construct($apiProvider, $apiRequest, $apiKernel);
37 }
38
39 /**
40 * @return mixed
41 */
42 public function getResponse() {
43 return $this->response;
44 }
45
46 /**
47 * @param mixed $response
48 * The response to return to the client.
49 */
50 public function setResponse($response) {
51 $this->response = $response;
52 }
53
54 }