1 | <?php |
||
6 | class Box extends Base |
||
7 | { |
||
8 | |||
9 | /** |
||
10 | * Private constructor so only the client can create this |
||
11 | * @param Client $client |
||
12 | */ |
||
13 | 20 | public function __construct(Client $client) |
|
18 | |||
19 | |||
20 | /** |
||
21 | * Get one or multiple boxes |
||
22 | * @param string box id, leave null for list of boxes |
||
23 | * @param object Containing query arguments |
||
24 | * @return object Result of the request |
||
25 | */ |
||
26 | public function Get($boxId = null, $args = array("limit" => 50)) |
||
33 | |||
34 | /** |
||
35 | * Get all box codes |
||
36 | * @param string box id |
||
37 | * @param object Containing query arguments |
||
38 | * @return object Result of the request |
||
39 | */ |
||
40 | public function GetCode($boxId, $args = array("limit" => 50)) |
||
44 | |||
45 | /** |
||
46 | * Get one or multiple versions of a box |
||
47 | * @param string box id |
||
48 | * @param string version id, leave null for list of versions |
||
49 | * @param object Containing query arguments |
||
50 | * @return object Result of the request |
||
51 | */ |
||
52 | public function GetVersion($boxId, $versionId = null, $args = array("limit" => 50)) |
||
59 | |||
60 | /** |
||
61 | * Create new box |
||
62 | * @param object Containing all the information of a box |
||
63 | * @return object Result of the request |
||
64 | */ |
||
65 | public function Create($box) |
||
69 | |||
70 | /** |
||
71 | * Create new box |
||
72 | * @param object Containing all the information of a box |
||
73 | * @return object Result of the request |
||
74 | */ |
||
75 | public function CreateVersion($boxId, $version) |
||
79 | |||
80 | /** |
||
81 | * Delete a box version by version id |
||
82 | * @param string Id of the box |
||
83 | * @param string Id of the version to be deleted |
||
84 | * @return object Result of the request |
||
85 | */ |
||
86 | public function Delete($boxId) |
||
90 | |||
91 | /** |
||
92 | * Delete a box version by version id |
||
93 | * @param string Id of the box |
||
94 | * @param string Id of the version to be deleted |
||
95 | * @return object Result of the request |
||
96 | */ |
||
97 | public function DeleteVersion($boxId, $versionId) |
||
101 | |||
102 | /** |
||
103 | * Update a box |
||
104 | * @param object Box containing the boxid and fields that need to be updated |
||
105 | * @throws \Exception When boxid is not present |
||
106 | * @return object Result of the request |
||
107 | */ |
||
108 | public function Update($box) |
||
116 | |||
117 | /** |
||
118 | * Update a box |
||
119 | * @param string Id of the box |
||
120 | * @param object Version containing the version and fields that need to be updated |
||
121 | * @throws \Exception When versionid is not present |
||
122 | * @return object Result of the request |
||
123 | */ |
||
124 | public function UpdateVersion($boxid, $version) |
||
132 | } |
||
133 |