|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * @author @jayS-de <jens.schulze@commercetools.de> |
| 4 | + * @created: 26.01.15, 18:14 |
| 5 | + */ |
| 6 | + |
| 7 | +namespace Commercetools\Core\Request\Categories; |
| 8 | + |
| 9 | +use Commercetools\Core\Model\Common\Context; |
| 10 | +use Commercetools\Core\Request\AbstractUpdateByKeyRequest; |
| 11 | +use Commercetools\Core\Model\Category\Category; |
| 12 | +use Commercetools\Core\Response\ApiResponseInterface; |
| 13 | +use Commercetools\Core\Model\MapperInterface; |
| 14 | + |
| 15 | +/** |
| 16 | + * @package Commercetools\Core\Request\Categories |
| 17 | + * @link https://dev.commercetools.com/http-api-projects-categories.html#update-category |
| 18 | + * @method Category mapResponse(ApiResponseInterface $response) |
| 19 | + * @method Category mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null) |
| 20 | + */ |
| 21 | +class CategoryUpdateByKeyRequest extends AbstractUpdateByKeyRequest |
| 22 | +{ |
| 23 | + protected $resultClass = Category::class; |
| 24 | + |
| 25 | + /** |
| 26 | + * @param string $key |
| 27 | + * @param int $version |
| 28 | + * @param array $actions |
| 29 | + * @param Context $context |
| 30 | + */ |
| 31 | + public function __construct($key, $version, array $actions = [], Context $context = null) |
| 32 | + { |
| 33 | + parent::__construct(CategoriesEndpoint::endpoint(), $key, $version, $actions, $context); |
| 34 | + } |
| 35 | + |
| 36 | + /** |
| 37 | + * @param string $key |
| 38 | + * @param int $version |
| 39 | + * @param Context $context |
| 40 | + * @return static |
| 41 | + */ |
| 42 | + public static function ofKeyAndVersion($key, $version, Context $context = null) |
| 43 | + { |
| 44 | + return new static($key, $version, [], $context); |
| 45 | + } |
| 46 | +} |
0 commit comments