PluginProbe
Order Tracking – WordPress Status Tracking Plugin / 3.2.2
Order Tracking – WordPress Status Tracking Plugin v3.2.2
3.5.4 3.5.3 3.5.2 3.5.1 3.5.0 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.3.0 3.3.1 3.3.10 3.3.11 3.3.12 3.3.13 3.3.14 3.3.15 All 235 releases
order-tracking / views / Base.class.php

Base.class.php in Order Tracking – WordPress Status Tracking Plugin 3.2.2, at views/Base.class.php

74 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Base class
5 *
6 * @since 3.0.0
7 */
8
9 // Load library classes
10 require_once( EWD_OTP_PLUGIN_DIR . '/views/View.class.php' );
11 require_once( EWD_OTP_PLUGIN_DIR . '/views/View.Admin.class.php' );
12 require_once( EWD_OTP_PLUGIN_DIR . '/views/View.AdminCustomerForm.class.php' );
13 require_once( EWD_OTP_PLUGIN_DIR . '/views/View.AdminOrderForm.class.php' );
14 require_once( EWD_OTP_PLUGIN_DIR . '/views/View.AdminSalesRepForm.class.php' );
15 require_once( EWD_OTP_PLUGIN_DIR . '/views/View.CustomerForm.class.php' );
16 require_once( EWD_OTP_PLUGIN_DIR . '/views/View.CustomerOrderForm.class.php' );
17 require_once( EWD_OTP_PLUGIN_DIR . '/views/View.OrderForm.class.php' );
18 require_once( EWD_OTP_PLUGIN_DIR . '/views/View.SalesRepForm.class.php' );
19
20 class ewdotpBase {
21
22 public $id = null;
23
24 // Collect errors during processing
25 public $errors = array();
26
27
28 /**
29 * Initialize the class
30 * @since 3.0.0
31 */
32 public function __construct( $args ) {
33
34 // Parse the values passed
35 $this->parse_args( $args );
36
37 }
38
39 /**
40 * Parse the arguments passed in the construction and assign them to
41 * internal variables.
42 * @since 3.0.0
43 */
44 public function parse_args( $args ) {
45 foreach ( $args as $key => $val ) {
46 switch ( $key ) {
47
48 case 'id' :
49 $this->{$key} = esc_attr( $val );
50
51 default :
52 $this->{$key} = $val;
53
54 }
55 }
56 }
57
58 /**
59 * Set an error
60 * @since 3.0.0
61 */
62 public function set_error( $error ) {
63 $this->errors[] = array_merge(
64 $error,
65 array(
66 'class' => get_class( $this ),
67 'id' => $this->id,
68 'backtrace' => debug_backtrace()
69 )
70 );
71 }
72
73 }
74