clientTools_service.php
1.12 KB
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
<?php
class clientTools_service{
//Service error codes
const ERR_SERVICE_RESOURCE_NOT_FOUND=200;
protected $response;
protected $errors;
protected $debug;
protected $dispatcher;
public $kt=null;
public $session=null;
public $session_id=null;
public function __construct(&$kt=null,&$session=null,$session_id=null,&$dispatcher=null){
$this->kt=&$kt;
$this->session=&$session;
$this->session_id=$session_id;
$this->dispatcher=&$dispatcher;
}
protected function setResponse($name=NULL,$obj=NULL){
if(!is_array($this->response))$this->response=array();
$this->response[$name]=$obj;
}
protected function setError($code=0,$message=''){
$this->errors[]=array('code'=>$code,'message'=>$message);
}
protected function setDebug($title='',$obj=NULL){
$this->debug[$title]=$obj;
}
public function getResponse(){
if(!is_array($this->response))$this->response=array();
return $this->response;
}
public function getDebug(){
if(!is_array($this->debug))$this->debug=array();
return $this->debug;
}
public function getErrors(){
if(!is_array($this->errors))$this->errors=array();
return $this->errors;
}
}
?>