1 | <?php |
||
4 | class Bucket extends Base |
||
5 | { |
||
6 | /** |
||
7 | * Private constructor so only the client can create this |
||
8 | * @param string $apikey |
||
9 | * @param string $projectid |
||
10 | */ |
||
11 | public function __construct($apikey, $projectid) |
||
15 | |||
16 | /** |
||
17 | * Get one or multiple buckets |
||
18 | * @param string bucket id, leave null for list of buckets |
||
19 | * @param object Containing query arguments |
||
20 | * @return object Result of the request |
||
21 | */ |
||
22 | public function Get($bucketId = null, $args = array("limit" => 50)) |
||
26 | |||
27 | /** |
||
28 | * Get one or multiple buckets |
||
29 | * @param string bucket id |
||
30 | * @param string object id, leave null for list of objects |
||
31 | * @param object Containing query arguments |
||
32 | * @return object Result of the request |
||
33 | */ |
||
34 | public function GetObject($bucketId, $objectId, $args = array("limit" => 50)) |
||
38 | |||
39 | /** |
||
40 | * Create new bucket |
||
41 | * @param object Containing all the information of a bucket |
||
42 | * @return object Result of the request |
||
43 | */ |
||
44 | public function Create($bucket) |
||
48 | |||
49 | /** |
||
50 | * Create new bucket |
||
51 | * @param string bucket id |
||
52 | * @param object Containing all the information of a bucket |
||
53 | * @return object Result of the request |
||
54 | */ |
||
55 | public function CreateObject($bucketId, $object) |
||
59 | |||
60 | /** |
||
61 | * Delete a bucket object by bucket id |
||
62 | * @param string Id of the bucket |
||
63 | * @return object Result of the request |
||
64 | */ |
||
65 | public function Delete($bucketId) |
||
69 | |||
70 | /** |
||
71 | * List fields of a bucket |
||
72 | * @param string Id of the bucket |
||
73 | * @return object Result of the request |
||
74 | */ |
||
75 | public function Fields($bucketId) |
||
79 | |||
80 | /** |
||
81 | * Updates a maximum of 50 object at a time |
||
82 | * @param array Containing objects with a maximum of 50 |
||
83 | * @throws \Exception When more that 50 objects are provided |
||
84 | * @return object Result of the request |
||
85 | */ |
||
86 | public function UpdateBulk($bucketId, $items) |
||
94 | } |
||
95 |