WuBookRestrictions::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 4
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 WuBookRestrictions
18
 *
19
 * @author Filippo Galante <[email protected]>
20
 */
21
class WuBookRestrictions 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/rstrs.html#rplan_add_rplan
41
     *
42
     * @param string $name
43
     * @param int $compact 0|1
44
     * @return mixed
45
     */
46
    public function rplan_add_rplan($name, $compact = 1)
47
    {
48
        return $this->call_method($this->token, 'rplan_add_rplan', [$name, $compact]);
49
    }
50
51
    /**
52
     * http://tdocs.wubook.net/wired/rstrs.html#rplan_rplans
53
     *
54
     * @return mixed
55
     */
56
    public function rplan_rplans()
57
    {
58
        return $this->call_method($this->token, 'rplan_rplans');
59
    }
60
61
    /**
62
     * http://tdocs.wubook.net/wired/rstrs.html#rplan_del_rplan
63
     *
64
     * @param int $id
65
     * @return mixed
66
     */
67
    public function rplan_del_rplan($id)
68
    {
69
        return $this->call_method($this->token, 'rplan_del_rplan', [$id]);
70
    }
71
72
    /**
73
     * http://tdocs.wubook.net/wired/rstrs.html#rplan_rename_rplan
74
     *
75
     * @param int $id
76
     * @return mixed
77
     */
78
    public function rplan_rename_rplan($id, $name)
79
    {
80
        return $this->call_method($this->token, 'rplan_rename_rplan', [$id, $name]);
81
    }
82
83
    /**
84
     * http://tdocs.wubook.net/wired/rstrs.html#rplan_update_rplan_rules
85
     *
86
     * @param int $id
87
     * @param array $rules
88
     * @return mixed
89
     */
90
    public function rplan_update_rplan_rules($id, $rules)
91
    {
92
        return $this->call_method($this->token, 'rplan_update_rplan_rules', [$id, $rules]);
93
    }
94
95
    /**
96
     * http://tdocs.wubook.net/wired/rstrs.html#rplan_update_rplan_values
97
     *
98
     * @param int $id
99
     * @param string $dfrom
100
     * @param array $values
101
     * @return mixed
102
     */
103
    public function rplan_update_rplan_values($id, $dfrom, $values)
104
    {
105
        return $this->call_method($this->token, 'rplan_update_rplan_values', [$id, $dfrom, $values]);
106
    }
107
108
    /**
109
     * http://tdocs.wubook.net/wired/rstrs.html#rplan_get_rplan_values
110
     *
111
     * @param string $dfrom
112
     * @param string $dto
113
     * @param array $rpids
114
     * @return mixed
115
     */
116
    public function rplan_get_rplan_values($dfrom, $dto, $rpids = [])
117
    {
118
        return $this->call_method($this->token, 'rplan_get_rplan_values', [$dfrom, $dto, $rpids]);
119
    }
120
}
121