1 | <?php |
||
4 | class Content 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 contents |
||
18 | * @param string content id, leave null for list of boxes |
||
19 | * @param object Containing query arguments |
||
20 | * @return object Result of the request |
||
21 | */ |
||
22 | public function Get($contentId = null, $args = array("limit" => 50, 'type' => 'item', 'itemtype' => 'product')) |
||
31 | |||
32 | /** |
||
33 | * Create new content |
||
34 | * @param object Containing all the information of a content |
||
35 | * @return object Result of the request |
||
36 | */ |
||
37 | public function Create($content) |
||
41 | |||
42 | /** |
||
43 | * Create new content |
||
44 | * @param object Containing all the information of a content |
||
45 | * @throws \Exception When contentid, source, type or itemtype is not present |
||
46 | * @return object Result of the request |
||
47 | */ |
||
48 | public function Update($content) |
||
66 | |||
67 | /** |
||
68 | * Delete a content object by content id |
||
69 | * @param string Id of the content |
||
70 | * @return object Result of the request |
||
71 | */ |
||
72 | public function Delete($contentId, $args = array('type' => 'item', 'itemtype' => 'product')) |
||
89 | |||
90 | /** |
||
91 | * Updates a maximum of 50 content items at a time. |
||
92 | * @param array Containing content items with a maximum of 50 |
||
93 | * @throws \Exception When more that 50 content items are provided |
||
94 | * @return object Result of the request |
||
95 | */ |
||
96 | public function UpdateBulk($items) |
||
104 | } |
||
105 |