From 710c89e7c5e14ba5de737873062b53ef3d6c695e Mon Sep 17 00:00:00 2001 From: Jens Schulze Date: Thu, 10 Mar 2016 12:55:00 +0100 Subject: [PATCH] feat(Review): add update by key request --- .../Reviews/ReviewUpdateByKeyRequest.php | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/Request/Reviews/ReviewUpdateByKeyRequest.php diff --git a/src/Request/Reviews/ReviewUpdateByKeyRequest.php b/src/Request/Reviews/ReviewUpdateByKeyRequest.php new file mode 100644 index 0000000000..78e53270c8 --- /dev/null +++ b/src/Request/Reviews/ReviewUpdateByKeyRequest.php @@ -0,0 +1,44 @@ + + */ + +namespace Commercetools\Core\Request\Reviews; + +use Commercetools\Core\Model\Common\Context; +use Commercetools\Core\Request\AbstractUpdateByKeyRequest; +use Commercetools\Core\Request\AbstractUpdateRequest; +use Commercetools\Core\Model\Review\Review; +use Commercetools\Core\Response\ApiResponseInterface; + +/** + * @package Commercetools\Core\Request\Reviews + * @link https://dev.commercetools.com/http-api-projects-reviews.html#update-review + * @method Review mapResponse(ApiResponseInterface $response) + */ +class ReviewUpdateByKeyRequest extends AbstractUpdateByKeyRequest +{ + protected $resultClass = '\Commercetools\Core\Model\Review\Review'; + + /** + * @param string $key + * @param string $version + * @param array $actions + * @param Context $context + */ + public function __construct($key, $version, array $actions = [], Context $context = null) + { + parent::__construct(ReviewsEndpoint::endpoint(), $key, $version, $actions, $context); + } + + /** + * @param string $key + * @param int $version + * @param Context $context + * @return static + */ + public static function ofKeyAndVersion($key, $version, Context $context = null) + { + return new static($key, $version, [], $context); + } +}