1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Commercetools\Core\Request\Carts; |
4
|
|
|
|
5
|
|
|
use Commercetools\Core\Model\Common\Context; |
6
|
|
|
use Commercetools\Core\Request\AbstractDeleteByKeyRequest; |
7
|
|
|
use Commercetools\Core\Model\Cart\Cart; |
8
|
|
|
use Commercetools\Core\Request\DataErasureTrait; |
9
|
|
|
use Commercetools\Core\Request\InStores\InStoreRequestDecorator; |
10
|
|
|
use Commercetools\Core\Request\InStores\InStoreTrait; |
11
|
|
|
use Commercetools\Core\Response\ApiResponseInterface; |
12
|
|
|
use Commercetools\Core\Model\MapperInterface; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* @package Commercetools\Core\Request\Carts |
16
|
|
|
* @link https://docs.commercetools.com/api/projects/carts#delete-a-cart-by-key |
17
|
|
|
* @method Cart mapResponse(ApiResponseInterface $response) |
18
|
|
|
* @method Cart mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null) |
19
|
|
|
* @method CartDeleteByKeyRequest|InStoreRequestDecorator inStore($storeKey) |
20
|
|
|
*/ |
21
|
|
|
class CartDeleteByKeyRequest extends AbstractDeleteByKeyRequest |
22
|
|
|
{ |
23
|
|
|
use DataErasureTrait; |
24
|
|
|
use InStoreTrait; |
25
|
|
|
|
26
|
|
|
protected $resultClass = Cart::class; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @param string $key |
30
|
|
|
* @param int $version |
31
|
|
|
* @param Context $context |
32
|
|
|
*/ |
33
|
|
|
public function __construct($key, $version, Context $context = null) |
34
|
|
|
{ |
35
|
|
|
parent::__construct(CartsEndpoint::endpoint(), $key, $version, $context); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @param string $key |
40
|
|
|
* @param int $version |
41
|
|
|
* @param Context $context |
42
|
|
|
* @return static |
43
|
|
|
*/ |
44
|
|
|
public static function ofKeyAndVersion($key, $version, Context $context = null) |
45
|
|
|
{ |
46
|
|
|
return new static($key, $version, $context); |
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
|