-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMonsumAddon.php
77 lines (60 loc) · 1.97 KB
/
MonsumAddon.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/*
* Monsum API Wrapper
* Licensed under the MIT License (MIT)
*/
class MonsumAddon
{
protected $api_obj = null;
protected $ado_data = null;
public function __construct($api_obj) {
$this->api_obj = $api_obj;
}
public function loadAddonFromData($arr) {
$this->ado_data = $arr;
}
public function loadAddonByID($addonid = "") {
$this->ado_data = null;
$query = array("SERVICE" => "addon.get",
"FILTER" => array("ARTICLE_NUMBER" => $addonid),
"LIMIT" => 1);
if($this->api_obj->api_call($query, true))
$this->ado_data = $this->api_obj->get_data()->ADDONS[0];
}
public function dump() {
if(isset($this->ado_data))
print_r($this->ado_data);
}
public function getID() {
return (isset($this->art_data) ? $this->ado_data->ARTICLE_ID : "");
}
public function getNumber() {
return (isset($this->ado_data) ? $this->ado_data->ARTICLE_NUMBER : "");
}
public function getTitle() {
return (isset($this->ado_data) ? $this->ado_data->TITLE : "");
}
public function getDescription() {
return (isset($this->ado_data) ? $this->ado_data->DESCRIPTION : "");
}
public function getUnitPrice() {
return (isset($this->ado_data) ? $this->ado_data->UNIT_PRICE : "");
}
public function getSetupFee() {
return (isset($this->ado_data) ? $this->ado_data->SETUP_FEE : "");
}
public function allowMultiple() {
if(isset($this->ado_data->ALLOW_MULTIPLE) && $this->ado_data->ALLOW_MULTIPLE == 1)
return true;
return false;
}
public function isDigital() {
if(isset($this->ado_data->IS_DIGITAL) && $this->ado_data->IS_DIGITAL == 1)
return true;
return false;
}
public function getConnectedArticles() {
return (isset($this->ado_data) ? $this->ado_data->CONNECTED_ARTICLES : "");
}
}
?>