1: <?php
2: /**
3: * This code is licensed under AGPLv3 license or Afterlogic Software License
4: * if commercial version of the product was purchased.
5: * For full statements of the licenses see LICENSE-AFTERLOGIC and LICENSE-AGPL3 files.
6: */
7:
8: namespace Aurora\System\Exceptions;
9:
10: /**
11: * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0
12: * @license https://afterlogic.com/products/common-licensing Afterlogic Software License
13: * @copyright Copyright (c) 2019, Afterlogic Corp.
14: *
15: * @category Core
16: * @package Exceptions
17: */
18: class ApiException extends Exception
19: {
20: /**
21: * @var array
22: */
23: protected $aObjectParams;
24:
25:
26: /**
27: * @var \Aurora\System\Module\AbstractModule
28: */
29: protected $oModule;
30:
31: /**
32: * ApiException constructor.
33: *
34: * @param null|int $iCode
35: * @param null|\Throwable $oPrevious
36: * @param null|string $sMessage
37: * @param null|array $aObjectParams
38: * @psalm-param null|array<string, string|int|mixed> $aObjectParams
39: * @param null|\Aurora\System\Module\AbstractModule $oModule
40: */
41: public function __construct($iCode, $oPrevious = null, $sMessage = '', $aObjectParams = array(), $oModule = null)
42: {
43: $this->aObjectParams = $aObjectParams;
44: $this->oModule = $oModule;
45: $mCode = is_int($iCode) ? $iCode : 0;
46: parent::__construct('' === $sMessage ? 'ApiException' : $sMessage, $mCode, $oPrevious);
47: }
48:
49: /**
50: * @return array
51: */
52: public function GetObjectParams()
53: {
54: return $this->aObjectParams;
55: }
56:
57: /**
58: * @return \Aurora\System\Module\AbstractModule
59: */
60: public function GetModule()
61: {
62: return $this->oModule;
63: }
64: }
65: