commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ResourceByProjectKeyCarts.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}/carts', $args, $client);
27 }
28
32 {
33 $args = $this->getArgs();
34
35 return new ResourceByProjectKeyCartsReplicate($args, $this->getClient());
36 }
39 public function withCustomerId(?string $customerId = null): ResourceByProjectKeyCartsCustomerIdByCustomerId
40 {
41 $args = $this->getArgs();
42 if (!is_null($customerId)) {
43 $args['customerId'] = $customerId;
44 }
45
47 }
51 {
52 $args = $this->getArgs();
53 if (!is_null($customerId)) {
54 $args['customerId'] = $customerId;
55 }
56
58 }
61 public function withKey(?string $key = null): ResourceByProjectKeyCartsKeyByKey
62 {
63 $args = $this->getArgs();
64 if (!is_null($key)) {
65 $args['key'] = $key;
66 }
67
68 return new ResourceByProjectKeyCartsKeyByKey($args, $this->getClient());
69 }
72 public function withId(?string $ID = null): ResourceByProjectKeyCartsByID
73 {
74 $args = $this->getArgs();
75 if (!is_null($ID)) {
76 $args['ID'] = $ID;
77 }
78
79 return new ResourceByProjectKeyCartsByID($args, $this->getClient());
80 }
81
86 public function get($body = null, array $headers = []): ByProjectKeyCartsGet
87 {
88 $args = $this->getArgs();
89
90 return new ByProjectKeyCartsGet($args['projectKey'], $body, $headers, $this->getClient());
91 }
96 public function head($body = null, array $headers = []): ByProjectKeyCartsHead
97 {
98 $args = $this->getArgs();
99
100 return new ByProjectKeyCartsHead($args['projectKey'], $body, $headers, $this->getClient());
101 }
106 public function post(?CartDraft $body = null, array $headers = []): ByProjectKeyCartsPost
107 {
108 $args = $this->getArgs();
109
110 return new ByProjectKeyCartsPost($args['projectKey'], $body, $headers, $this->getClient());
111 }
112}
__construct(array $args=[], ?ClientInterface $client=null)