PluginProbe
StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates & More / 2.2.0
StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates & More v2.2.0
2.3.0 2.2.0 2.1.1 2.1.0 2.0.0 1.10.0 1.9.1 1.9.0 1.2.1 1.2.2 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.0 All 59 releases
storeengine / includes / classes / store-engine-exception.php

store-engine-exception.php in StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates & More 2.2.0, at includes/classes/store-engine-exception.php

44 lines 799 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace StoreEngine\Classes;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 die();
7 }
8
9 use Exception;
10 use WP_Error;
11
12 /**
13 * WP_Error compatible exception.
14 *
15 * @deprecated moved to StoreEngine\Classes\Exceptions\StoreEngineException;
16 */
17 class StoreEngineException extends Exception {
18
19 protected $wp_code;
20
21 protected $data = '';
22
23 public function __construct( $message, $wp_code, $data = null, $code = 0, ?Exception $previous = null ) {
24 parent::__construct( $message, $code, $previous );
25
26 $this->wp_code = $wp_code;
27 if ( $data ) {
28 $this->data = $data;
29 }
30 }
31
32 public function get_wp_code() {
33 return $this->wp_code;
34 }
35
36 public function get_data() {
37 return $this->data;
38 }
39
40 public function get_wp_error() {
41 return new WP_Error( $this->wp_code, $this->getMessage(), $this->data );
42 }
43 }
44