PluginProbe
MainWP Dashboard: Self-hosted WordPress Management for Agencies / 4.4.1
MainWP Dashboard: Self-hosted WordPress Management for Agencies v4.4.1
6.2 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1 6.0.12 6.0.11 4.6.0.1 5.0 5.0.1 5.0.2 5.0.3 5.0.3.1 5.0.3.2 5.1 5.1.1 5.2 5.2.1 5.2.2 5.3 All 153 releases
mainwp / class / class-mainwp-exception.php

class-mainwp-exception.php in MainWP Dashboard: Self-hosted WordPress Management for Agencies 4.4.1, at class/class-mainwp-exception.php

86 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Extends MainWP Exception
4 *
5 * Grabs $extra and stores it in $messageExtra.
6 *
7 * @package MainWP/Dashboard
8 */
9
10 namespace MainWP\Dashboard;
11
12 /**
13 * Class MainWP_Exception
14 *
15 * @package MainWP\Dashboard
16 */
17 class MainWP_Exception extends \Exception {
18
19
20 /**
21 * Protected variable to hold the extra messages.
22 *
23 * @var string Error messages.
24 */
25 protected $messageExtra;
26
27 /**
28 * Protected variable to hold the extra data.
29 *
30 * @var array data.
31 */
32 protected $data;
33
34 /**
35 * MainWP_Exception constructor.
36 *
37 * Grab Exception Message upon creation of the object.
38 *
39 * @param mixed $message Exception message.
40 * @param null $extra Any extra Errors.
41 * @param string $errCode Errors code.
42 */
43 public function __construct( $message, $extra = null, $errCode = '' ) {
44 parent::__construct( $message );
45 $this->messageExtra = esc_html( $extra ); // add more secure.
46 $this->errorCode = esc_html( $errCode );
47 }
48
49 /**
50 * Method get_message_extra()
51 *
52 * @return $messageExtra Extra messages.
53 */
54 public function get_message_extra() {
55 return $this->messageExtra;
56 }
57
58 /**
59 * Method get_message_error_code()
60 *
61 * @return string $errorCode Errors code.
62 */
63 public function get_message_error_code() {
64 return $this->errorCode;
65 }
66
67 /**
68 * Method set_data()
69 *
70 * @param mixed $data Addition data.
71 */
72 public function set_data( $data ) {
73 $this->data = $data;
74 }
75
76 /**
77 * Method get_data()
78 *
79 * @return $data Addition data.
80 */
81 public function get_data() {
82 return $this->data;
83 }
84
85 }
86