for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Commercetools\Core\Request\Carts;
use Commercetools\Core\Model\Cart\Cart;
use Commercetools\Core\Model\Common\Context;
use Commercetools\Core\Request\AbstractByKeyGetRequest;
use Commercetools\Core\Request\InStores\InStoreRequestDecorator;
use Commercetools\Core\Request\InStores\InStoreTrait;
use Commercetools\Core\Response\ApiResponseInterface;
use Commercetools\Core\Model\MapperInterface;
/**
* @package Commercetools\Core\Request\Carts
* @link https://docs.commercetools.com/api/projects/carts#get-a-cart-by-key
* @method Cart mapResponse(ApiResponseInterface $response)
* @method Cart mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
* @method CartByKeyGetRequest|InStoreRequestDecorator inStore($storeKey)
*/
class CartByKeyGetRequest extends AbstractByKeyGetRequest
{
use InStoreTrait;
protected $resultClass = Cart::class;
* @param string $key
* @param Context $context
public function __construct($key, Context $context = null)
parent::__construct(CartsEndpoint::endpoint(), $key, $context);
}
* @return static
public static function ofKey($key, Context $context = null)
return new static($key, $context);