|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of Laravel WuBook. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) Filippo Galante <[email protected]> |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace IlGala\LaravelWubook\Api; |
|
13
|
|
|
|
|
14
|
|
|
use IlGala\LaravelWubook\Api\WuBookApi; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Description of WuBookCancellationPolicies |
|
18
|
|
|
* |
|
19
|
|
|
* @author Filippo Galante <[email protected]> |
|
20
|
|
|
*/ |
|
21
|
|
|
class WuBookCancellationPolicies extends WuBookApi |
|
22
|
|
|
{ |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* @var string |
|
26
|
|
|
*/ |
|
27
|
|
|
private $token; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* Create a new WuBookRooms Instance. |
|
31
|
|
|
*/ |
|
32
|
|
|
public function __construct($config, $cache, $client, $token = null) |
|
33
|
|
|
{ |
|
34
|
|
|
parent::__construct($config, $cache, $client); |
|
35
|
|
|
|
|
36
|
|
|
$this->token = $token; |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* http://tdocs.wubook.net/wired/cpolicies.html#fetch_policies |
|
41
|
|
|
* |
|
42
|
|
|
* @param int $ancillary |
|
43
|
|
|
* @return mixed |
|
44
|
|
|
*/ |
|
45
|
|
|
public function fetch_policies($ancillary = 0) |
|
46
|
|
|
{ |
|
47
|
|
|
return $this->call_method($this->token, 'fetch_policies', [$ancillary]); |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* http://tdocs.wubook.net/wired/cpolicies.html#new_policy |
|
52
|
|
|
* |
|
53
|
|
|
* @param array $data |
|
54
|
|
|
* @return mixed |
|
55
|
|
|
*/ |
|
56
|
|
|
public function new_policy($data) |
|
57
|
|
|
{ |
|
58
|
|
|
return $this->call_method($this->token, 'new_policy', $data); |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* http://tdocs.wubook.net/wired/cpolicies.html#mod_policy |
|
63
|
|
|
* |
|
64
|
|
|
* @param array $data |
|
65
|
|
|
* @return mixed |
|
66
|
|
|
*/ |
|
67
|
|
|
public function mod_policy($data) |
|
68
|
|
|
{ |
|
69
|
|
|
return $this->call_method($this->token, 'mod_policy', $data); |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* http://tdocs.wubook.net/wired/cpolicies.html#del_policy |
|
74
|
|
|
* |
|
75
|
|
|
* @param int $id |
|
76
|
|
|
* @return mixed |
|
77
|
|
|
*/ |
|
78
|
|
|
public function del_policy($id) |
|
79
|
|
|
{ |
|
80
|
|
|
return $this->call_method($this->token, 'del_policy', [$id]); |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* http://tdocs.wubook.net/wired/cpolicies.html#fetch_policy_calendar |
|
85
|
|
|
* |
|
86
|
|
|
* @param string $dfrom |
|
87
|
|
|
* @param string $dto |
|
88
|
|
|
* @return mixed |
|
89
|
|
|
*/ |
|
90
|
|
|
public function fetch_policy_calendar($dfrom, $dto) |
|
91
|
|
|
{ |
|
92
|
|
|
return $this->call_method($this->token, 'fetch_policy_calendar', [$dfrom, $dto]); |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* http://tdocs.wubook.net/wired/cpolicies.html#set_policy_calendar |
|
97
|
|
|
* |
|
98
|
|
|
* @param int $id |
|
99
|
|
|
* @param string $dfrom |
|
100
|
|
|
* @param string $dto |
|
101
|
|
|
* @return mixed |
|
102
|
|
|
*/ |
|
103
|
|
|
public function set_policy_calendar($id, $dfrom, $dto) |
|
104
|
|
|
{ |
|
105
|
|
|
return $this->call_method($this->token, 'set_policy_calendar', [$id, $dfrom, $dto]); |
|
106
|
|
|
} |
|
107
|
|
|
} |
|
108
|
|
|
|