* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ namespace PrestaShop\PrestaShop\Core\Domain\Cart\Command; use PrestaShop\PrestaShop\Core\Domain\Cart\Exception\CartConstraintException; use PrestaShop\PrestaShop\Core\Domain\Cart\ValueObject\CartId; /** * Updates cart carrier (a.k.a delivery option) with new one. */ class UpdateCartCarrierCommand { /** * @var CartId */ private $cartId; /** * @var int */ private $newCarrierId; /** * @param int $cartId * @param int $newCarrierId * * @throws CartConstraintException */ public function __construct($cartId, $newCarrierId) { $this->cartId = new CartId($cartId); $this->newCarrierId = $newCarrierId; } /** * @return CartId */ public function getCartId(): CartId { return $this->cartId; } /** * @return int */ public function getNewCarrierId(): int { return $this->newCarrierId; } }