|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @author @jayS-de <[email protected]> |
|
4
|
|
|
*/ |
|
5
|
|
|
|
|
6
|
|
|
namespace Commercetools\Core\Request\Reviews; |
|
7
|
|
|
|
|
8
|
|
|
use Commercetools\Core\Model\Common\Context; |
|
9
|
|
|
use Commercetools\Core\Request\AbstractUpdateRequest; |
|
10
|
|
|
use Commercetools\Core\Model\Review\Review; |
|
11
|
|
|
use Commercetools\Core\Response\ApiResponseInterface; |
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* @package Commercetools\Core\Request\Reviews |
|
15
|
|
|
* @apidoc http://dev.sphere.io/http-api-projects-reviews.html#update-review |
|
16
|
|
|
* @method Review mapResponse(ApiResponseInterface $response) |
|
17
|
|
|
*/ |
|
18
|
|
|
class ReviewUpdateRequest extends AbstractUpdateRequest |
|
19
|
|
|
{ |
|
20
|
|
|
protected $resultClass = '\Commercetools\Core\Model\Review\Review'; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* @param string $id |
|
24
|
|
|
* @param string $version |
|
25
|
|
|
* @param array $actions |
|
26
|
|
|
* @param Context $context |
|
27
|
|
|
*/ |
|
28
|
2 |
|
public function __construct($id, $version, array $actions = [], Context $context = null) |
|
29
|
|
|
{ |
|
30
|
2 |
|
parent::__construct(ReviewsEndpoint::endpoint(), $id, $version, $actions, $context); |
|
31
|
2 |
|
} |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @param string $id |
|
35
|
|
|
* @param int $version |
|
36
|
|
|
* @param Context $context |
|
37
|
|
|
* @return static |
|
38
|
|
|
*/ |
|
39
|
2 |
|
public static function ofIdAndVersion($id, $version, Context $context = null) |
|
40
|
|
|
{ |
|
41
|
2 |
|
return new static($id, $version, [], $context); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* @param string $key |
|
46
|
|
|
* @param int $version |
|
47
|
|
|
* @param Context $context |
|
48
|
|
|
* @return static |
|
49
|
|
|
*/ |
|
50
|
|
|
public static function ofKeyAndVersion($key, $version, Context $context = null) |
|
51
|
|
|
{ |
|
52
|
|
|
return new static('key=' . $key, $version, [], $context); |
|
53
|
|
|
} |
|
54
|
|
|
} |
|
55
|
|
|
|