commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ResourceByProjectKeyMeCarts.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}/me/carts', $args, $client);
27  }
28 
31  public function withKey(string $key = null): ResourceByProjectKeyMeCartsKeyByKey
32  {
33  $args = $this->getArgs();
34  if (!is_null($key)) {
35  $args['key'] = $key;
36  }
37 
38  return new ResourceByProjectKeyMeCartsKeyByKey($args, $this->getClient());
39  }
42  public function withId(string $ID = null): ResourceByProjectKeyMeCartsByID
43  {
44  $args = $this->getArgs();
45  if (!is_null($ID)) {
46  $args['ID'] = $ID;
47  }
48 
49  return new ResourceByProjectKeyMeCartsByID($args, $this->getClient());
50  }
54  {
55  $args = $this->getArgs();
56 
57  return new ResourceByProjectKeyMeCartsReplicate($args, $this->getClient());
58  }
59 
64  public function get($body = null, array $headers = []): ByProjectKeyMeCartsGet
65  {
66  $args = $this->getArgs();
67 
68  return new ByProjectKeyMeCartsGet($args['projectKey'], $body, $headers, $this->getClient());
69  }
74  public function head($body = null, array $headers = []): ByProjectKeyMeCartsHead
75  {
76  $args = $this->getArgs();
77 
78  return new ByProjectKeyMeCartsHead($args['projectKey'], $body, $headers, $this->getClient());
79  }
84  public function post(?MyCartDraft $body = null, array $headers = []): ByProjectKeyMeCartsPost
85  {
86  $args = $this->getArgs();
87 
88  return new ByProjectKeyMeCartsPost($args['projectKey'], $body, $headers, $this->getClient());
89  }
90 }