commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ResourceByProjectKeyCustomObjects.php
1<?php
2
3declare(strict_types=1);
10
13use GuzzleHttp\ClientInterface;
14use Psr\Http\Message\UploadedFileInterface;
15
20{
24 public function __construct(array $args = [], ClientInterface $client = null)
25 {
26 parent::__construct('/{projectKey}/custom-objects', $args, $client);
27 }
28
31 public function withContainerAndKey(string $container = null, string $key = null): ResourceByProjectKeyCustomObjectsByContainerByKey
32 {
33 $args = $this->getArgs();
34 if (!is_null($container)) {
35 $args['container'] = $container;
36 }
37
38 if (!is_null($key)) {
39 $args['key'] = $key;
40 }
41
43 }
46 public function withContainer(string $container = null): ResourceByProjectKeyCustomObjectsByContainer
47 {
48 $args = $this->getArgs();
49 if (!is_null($container)) {
50 $args['container'] = $container;
51 }
52
54 }
55
61 public function get($body = null, array $headers = []): ByProjectKeyCustomObjectsGet
62 {
63 $args = $this->getArgs();
64
65 return new ByProjectKeyCustomObjectsGet($args['projectKey'], $body, $headers, $this->getClient());
66 }
71 public function head($body = null, array $headers = []): ByProjectKeyCustomObjectsHead
72 {
73 $args = $this->getArgs();
74
75 return new ByProjectKeyCustomObjectsHead($args['projectKey'], $body, $headers, $this->getClient());
76 }
81 public function post(?CustomObjectDraft $body = null, array $headers = []): ByProjectKeyCustomObjectsPost
82 {
83 $args = $this->getArgs();
84
85 return new ByProjectKeyCustomObjectsPost($args['projectKey'], $body, $headers, $this->getClient());
86 }
87}