(NFC) (dev/core#878) Simplify copyright header (Civi/*)
[civicrm-core.git] / Civi / API / Event / ExceptionEvent.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 ExceptionEvent
16 * @package Civi\API\Event
17 */
18 class ExceptionEvent extends Event {
19
20 /**
21 * @var \Exception
22 */
23 private $exception;
24
25 /**
26 * @param \Exception $exception
27 * The exception which arose while processing the API request.
28 * @param \Civi\API\Provider\ProviderInterface $apiProvider
29 * The API provider responsible for executing the request.
30 * @param array $apiRequest
31 * The full description of the API request.
32 * @param \Civi\API\Kernel $apiKernel
33 * The kernel which fired the event.
34 */
35 public function __construct($exception, $apiProvider, $apiRequest, $apiKernel) {
36 $this->exception = $exception;
37 parent::__construct($apiProvider, $apiRequest, $apiKernel);
38 }
39
40 /**
41 * @return \Exception
42 */
43 public function getException() {
44 return $this->exception;
45 }
46
47 }