-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathExceptions.php
More file actions
96 lines (85 loc) · 2.75 KB
/
Exceptions.php
File metadata and controls
96 lines (85 loc) · 2.75 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
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
<?php
namespace pashkinz92\epochtasms;
class Exceptions{
private $gateway=NULL;
function __construct($gateway){
$this->gateway=$gateway;
}
/**
* Add phone to exceptions by phone number
*/
function addPhoneToExceptionsByPhone($phone,$reason){
return $this->gateway->execCommad('addPhoneToExceptions',array('phone'=>$phone,'reason'=>$reason));
}
/**
* Add phone to exceptions by phone ID
*/
function addPhoneToExceptionsByIdPhone($idPhone,$reason){
return $this->gateway->execCommad('addPhoneToExceptions',array('idPhone'=>$idPhone,'reason'=>$reason));
}
/**
* Delete phone from exceptions by phone number
*/
function delPhoneFromExceptionByPhone($phone){
return $this->gateway->execCommad('delPhoneFromExceptions',array('phone'=>$phone));
}
/**
* Delete phone from exceptions by phone ID
*/
function delPhoneFromExceptionByIdPhone($idPhone){
return $this->gateway->execCommad('delPhoneFromExceptions',array('idPhone'=>$idPhone));
}
/**
* Delete phone from exceptions by exception ID
*/
function delPhoneFromExceptionByIdException($idException){
return $this->gateway->execCommad('delPhoneFromExceptions',array('idException'=>$idException));
}
/**
* Edit exception by exception ID
*/
function editException($idException,$reason){
return $this->gateway->execCommad('editExceptions',array('idException'=>$idException, 'reason'=>$reason));
}
/**
* Get exception from exceptions by exception ID
*/
function getException($idException){
return $this->gateway->execCommad('getException',array('idException'=>$idException));
}
/**
* Get exception from exceptions by phone ID
*/
function getExceptionByIdPhone($idPhone){
return $this->gateway->execCommad('getException',array('idPhone'=>$idPhone));
}
/**
* Get all exceptions
*/
function getAllExceptions($from=null,$offset=null){
return $this->gateway->execCommad('getException',array('from'=>$from, 'offset'=>$offset),true);
}
/**
* Get exception by phone
*/
function getExceptionByPhone($phone){
return $this->gateway->execCommad('getException',array('phone'=>$phone));
}
/**
* Get exceptions by address book ID
*/
function getExceptionByIdAddresbook($idAddresbook){
return $this->gateway->execCommad('getException',array('idAddresbook'=>$idAddresbook));
}
/**
* Search excpetion
* Availible fields: id, phone, date, descr.
* Availible operations: like,=,>,>=,<,<=.
* Example for searchFields:
* $searchFields['phone']=array('operation'=>'like', 'value'=>"999%");
*/
function searchPhonesInExceptions($searchFields,$from=null,$offset=null){
$searchFields_json=json_encode($searchFields);
return $this->gateway->execCommad('searchPhonesInExceptions',array('searchFields'=>$searchFields_json, 'from'=>$from, 'offset'=>$offset),true);
}
}