commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ResourceByProjectKeyCustomObjects.php
1 <?php
2 
3 declare(strict_types=1);
10 
13 use GuzzleHttp\ClientInterface;
14 use 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 
53  return new ResourceByProjectKeyCustomObjectsByContainer($args, $this->getClient());
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 }