PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.15.0
GiveWP – Donation Plugin and Fundraising Platform v4.15.0
4.18.0 4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 All 257 releases
give / src / API / REST / V3 / Routes / Donations / Exceptions / DonationValidationException.php

DonationValidationException.php in GiveWP – Donation Plugin and Fundraising Platform 4.15.0, at src/API/REST/V3/Routes/Donations/Exceptions/DonationValidationException.php

61 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\API\REST\V3\Routes\Donations\Exceptions;
4
5 use Exception;
6
7 /**
8 * @since 4.8.0
9 */
10 class DonationValidationException extends Exception
11 {
12 /**
13 * @var string
14 */
15 private $errorCode;
16
17 /**
18 * @var int
19 */
20 private $statusCode;
21
22 /**
23 * @since 4.8.0
24 *
25 * @param string $message
26 * @param string $errorCode
27 * @param int $statusCode
28 * @param Exception|null $previous
29 */
30 public function __construct(string $message, string $errorCode, int $statusCode = 400, Exception $previous = null)
31 {
32 parent::__construct($message, 0, $previous);
33 $this->errorCode = $errorCode;
34 $this->statusCode = $statusCode;
35 }
36
37 /**
38 * Get the error code
39 *
40 * @since 4.8.0
41 *
42 * @return string
43 */
44 public function getErrorCode(): string
45 {
46 return $this->errorCode;
47 }
48
49 /**
50 * Get the HTTP status code
51 *
52 * @since 4.8.0
53 *
54 * @return int
55 */
56 public function getStatusCode(): int
57 {
58 return $this->statusCode;
59 }
60 }
61