This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Type): add type update by key request
- Loading branch information
Jens Schulze
committed
Mar 11, 2016
1 parent
422cdee
commit 72e4bd2
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
/** | ||
* @author @jayS-de <jens.schulze@commercetools.de> | ||
*/ | ||
|
||
namespace Commercetools\Core\Request\Types; | ||
|
||
use Commercetools\Core\Model\Common\Context; | ||
use Commercetools\Core\Request\AbstractUpdateByKeyRequest; | ||
use Commercetools\Core\Model\Type\Type; | ||
use Commercetools\Core\Response\ApiResponseInterface; | ||
|
||
/** | ||
* @package Commercetools\Core\Request\Types | ||
* @link https://dev.commercetools.com/http-api-projects-types.html#update-type-by-key | ||
* @method Type mapResponse(ApiResponseInterface $response) | ||
*/ | ||
class TypeUpdateByKeyRequest extends AbstractUpdateByKeyRequest | ||
{ | ||
protected $resultClass = '\Commercetools\Core\Model\Type\Type'; | ||
|
||
/** | ||
* @param string $key | ||
* @param string $version | ||
* @param array $actions | ||
* @param Context $context | ||
*/ | ||
public function __construct($key, $version, array $actions = [], Context $context = null) | ||
{ | ||
parent::__construct(TypesEndpoint::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); | ||
} | ||
} |