]> _ Git - physioassist-wordpress.git/blob
99bedbf8116fbfc29dbc2e69e4dd5178702642a1
[physioassist-wordpress.git] /
1 <?php
2
3 class OTGS_Installer_Package_Product {
4
5         private $id;
6         private $name;
7         private $description;
8         private $price;
9         private $subscription_type;
10         private $subscription_type_text;
11         private $subscription_info;
12         private $subscription_type_equivalent;
13         private $url;
14         private $renewals;
15         private $upgrades;
16         private $plugins;
17         private $downloads;
18
19         public function __construct( array $params = array() ) {
20                 foreach ( get_object_vars( $this ) as $property => $value ) {
21                         if ( array_key_exists( $property, $params ) ) {
22                                 $this->$property = $params[ $property ];
23                         }
24                 }
25         }
26
27         public function get_id() {
28                 return $this->id;
29         }
30
31         public function get_name() {
32                 return $this->name;
33         }
34
35         public function get_description() {
36                 return $this->description;
37         }
38
39         public function get_price() {
40                 return $this->price;
41         }
42
43         public function get_subscription_type() {
44                 return $this->subscription_type;
45         }
46
47         public function get_subscription_type_text() {
48                 return $this->subscription_type_text;
49         }
50
51         public function get_subscription_info() {
52                 return $this->subscription_info;
53         }
54
55         public function get_subscription_type_equivalent() {
56                 return (int) $this->subscription_type_equivalent;
57         }
58
59         public function get_url() {
60                 return $this->url;
61         }
62
63         public function get_renewals() {
64                 return $this->renewals;
65         }
66
67         public function get_upgrades() {
68                 return $this->upgrades;
69         }
70
71         public function get_plugins() {
72                 return $this->plugins;
73         }
74
75         /**
76          * @param string $slug
77          *
78          * @return bool
79          */
80         public function is_plugin_registered( $slug ) {
81                 foreach ( $this->plugins as $plugin ) {
82                         if ( $slug === $plugin ) {
83                                 return true;
84                         }
85                 }
86
87                 return false;
88         }
89
90         public function get_downloads() {
91                 return $this->downloads;
92         }
93 }