1 | <?php |
||
2 | |||
3 | namespace Resova\Endpoints; |
||
4 | |||
5 | use Resova\Client; |
||
6 | use Resova\Interfaces\QueryInterface; |
||
7 | |||
8 | class Items extends Client |
||
9 | { |
||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | protected $namespace = __CLASS__; |
||
14 | |||
15 | /** |
||
16 | * Retrieve a item |
||
17 | * Retrieves the details of a item. Provide the unique id for the item. |
||
18 | * |
||
19 | * @param int $item_id The item id |
||
20 | * |
||
21 | * @return $this |
||
22 | */ |
||
23 | public function __invoke(int $item_id): self |
||
24 | { |
||
25 | $this->item_id = $item_id; |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
26 | |||
27 | // Set HTTP params |
||
28 | $this->type = 'get'; |
||
29 | $this->endpoint = '/items/' . $item_id; |
||
30 | |||
31 | return $this; |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * List all items |
||
36 | * Returns a list of your items. The items are returned sorted by creation date, with the most recent item appearing first. |
||
37 | * |
||
38 | * @return $this |
||
39 | */ |
||
40 | public function all(): QueryInterface |
||
41 | { |
||
42 | // Set HTTP params |
||
43 | $this->type = 'get'; |
||
44 | $this->endpoint = '/items'; |
||
45 | |||
46 | return $this; |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * List all item booking questions |
||
51 | * Returns a list of your item booking questions. |
||
52 | * The items are returned sorted by creation date, with the most recent item appearing first. |
||
53 | * |
||
54 | * @return \Resova\Interfaces\QueryInterface |
||
55 | */ |
||
56 | public function booking_questions(): QueryInterface |
||
57 | { |
||
58 | // Set HTTP params |
||
59 | $this->type = 'get'; |
||
60 | $this->endpoint = '/items/' . $this->item_id . '/booking_questions'; |
||
61 | |||
62 | return $this; |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * List all item reviews |
||
67 | * Returns a list of your item reviews. |
||
68 | * The items are returned sorted by creation date, with the most recent item appearing first. |
||
69 | * |
||
70 | * @return \Resova\Interfaces\QueryInterface |
||
71 | */ |
||
72 | public function reviews(): QueryInterface |
||
73 | { |
||
74 | // Set HTTP params |
||
75 | $this->type = 'get'; |
||
76 | $this->endpoint = '/items/' . $this->item_id . '/reviews'; |
||
77 | |||
78 | return $this; |
||
79 | } |
||
80 | |||
81 | /** |
||
82 | * List all item extras |
||
83 | * Returns a list of your item extras. |
||
84 | * The items are returned sorted by creation date, with the most recent item appearing first. |
||
85 | * |
||
86 | * @return \Resova\Interfaces\QueryInterface |
||
87 | */ |
||
88 | public function extras(): QueryInterface |
||
89 | { |
||
90 | // Set HTTP params |
||
91 | $this->type = 'get'; |
||
92 | $this->endpoint = '/items/' . $this->item_id . '/extras'; |
||
93 | |||
94 | return $this; |
||
95 | } |
||
96 | } |
||
97 |