1 | <?php |
||
10 | class ApiException extends \Exception |
||
11 | { |
||
12 | protected $useDate = null; |
||
13 | |||
14 | protected $apiMessage = null; |
||
15 | |||
16 | protected $apiCodeError = 0; |
||
17 | |||
18 | /** |
||
19 | * Return the date of use for already use exception |
||
20 | * @return string |
||
21 | */ |
||
22 | public function getUseDate() |
||
26 | |||
27 | /** |
||
28 | * get api message error |
||
29 | * @return string |
||
30 | */ |
||
31 | public function getApiMessage() |
||
35 | |||
36 | /** |
||
37 | * Get api code error |
||
38 | * @return string |
||
39 | */ |
||
40 | public function getApiCodeError() |
||
44 | |||
45 | /** |
||
46 | * Exception if code already use |
||
47 | * @param string $code |
||
48 | * @param mixed $response |
||
49 | * @return \self |
||
50 | */ |
||
51 | 1 | public static function alreadyUsed($code, $response){ |
|
62 | |||
63 | /** |
||
64 | * Exception if code isn't valid |
||
65 | * @param string $code |
||
66 | * @param mixed $response |
||
67 | * @return \self |
||
68 | */ |
||
69 | 1 | public static function invalidCode($code, $response){ |
|
78 | |||
79 | /** |
||
80 | * Exception if unknow code |
||
81 | * @param mixed $response |
||
82 | * @return \self |
||
83 | */ |
||
84 | public static function unknowException($message, $response){ |
||
93 | |||
94 | 2 | private function baseException($response){ |
|
98 | } |
||
99 |