-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathticketnetwork_performer.class.php
110 lines (95 loc) · 2.47 KB
/
ticketnetwork_performer.class.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
/**
* @file ticketnetwork_performer.class.php
* @package TicketNetwork
*
* @license see LICENSE.txt
* @author jwwicks <jwwicks-at-gmail-dot-com>
*/
if(!class_exists('TicketNetworkBase')){
require_once('ticketnetwork.class.php');
}
/**
* @class TNPerformer
* @brief TicketNetwork Performers
*
* @since 0.0.1
*/
if(!class_exists('TicketNetworkBase')){
require_once('ticketnetwork.class.php');
}
class TNPerformer extends TicketNetworkBase{
public function __construct($options=false){
self::_defaults();
if($options){
self::config($options);
}
}
/**
*
'WebsiteConfigID' => WEB_CONF_ID,
'numReturned' => HIGH_INVENTORY_PERFORMERS_LENGTH,
'parentCategoryID' => null,
'childCategoryID' => null,
'grandchildCategoryID' => null
* @param string $params
* @return TNPerformer
*/
public function get($params=false){
$this->_request['method'] = 'GetEventPerformers';
if($params){
$this->set($params);
if(array_key_exists('method', $params)){
$this->_request['method'] = $params['method'];
unset($params['method']);
}
}
return $this;
}
/**
* Parse the results from TicketNetwork
* @return string|unknown
*/
public function parse(){
$this->_data = array();
try{
parent::parse();
if(!empty($this->_response)){
if($this->_request['method'] == 'GetEventPerformers'){
if(is_array($this->_response->GetEventPerformersResult->EventPerformer)){
foreach($this->_response->GetEventPerformersResult->EventPerformer as $performer){
$this->_data[] = $performer;
}
}else{
$this->_data = null;
}
}else if($this->_request['method'] == 'GetHighInventoryPerformers'){
if(is_array($this->_response->GetHighInventoryPerformersResult->PerformerPercent)){
foreach($this->_response->GetHighInventoryPerformersResult->PerformerPercent as $performer){
$this->_data[] = $performer;
}
}else{
$this->_data = null;
}
}else if($this->_request['method'] == 'GetHighSalesPerformers'){
if(is_array($this->_response->GetHighSalesPerformersResult->PerformerPercent)){
foreach($this->_response->GetHighSalesPerformersResult->PerformerPercent as $performer){
$this->_data[] = $performer;
}
}else{
$this->_data = null;
}
}
}
}catch(TNException $e){
}
return $this;
}
protected function _defaults(){
parent::_defaults();
$this->_request = array(
'method' => '',
'parameters' => array()
);
}
}