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(ProductType): add change inputHint update action
Closes #323
- Loading branch information
Jens Schulze
committed
Jun 30, 2017
1 parent
20d5b5c
commit af666f6
Showing
2 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
src/Core/Request/ProductTypes/Command/ProductTypeChangeInputHintAction.php
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,53 @@ | ||
<?php | ||
/** | ||
* @author @jayS-de <jens.schulze@commercetools.de> | ||
*/ | ||
|
||
namespace Commercetools\Core\Request\ProductTypes\Command; | ||
|
||
use Commercetools\Core\Model\Common\Context; | ||
use Commercetools\Core\Model\Common\LocalizedString; | ||
use Commercetools\Core\Request\AbstractAction; | ||
|
||
/** | ||
* @package Commercetools\Core\Request\ProductTypes\Command | ||
* @link https://dev.commercetools.com/http-api-projects-productTypes.html#change-attributedefinition-inputhint | ||
* @method string getAction() | ||
* @method ProductTypeChangeInputHintAction setAction(string $action = null) | ||
* @method string getAttributeName() | ||
* @method ProductTypeChangeInputHintAction setAttributeName(string $attributeName = null) | ||
* @method string getNewValue() | ||
* @method ProductTypeChangeInputHintAction setNewValue(string $newValue = null) | ||
*/ | ||
class ProductTypeChangeInputHintAction extends AbstractAction | ||
{ | ||
public function fieldDefinitions() | ||
{ | ||
return [ | ||
'action' => [static::TYPE => 'string'], | ||
'attributeName' => [static::TYPE => 'string'], | ||
'newValue' => [static::TYPE => 'string'] | ||
]; | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @param Context|callable $context | ||
*/ | ||
public function __construct(array $data = [], $context = null) | ||
{ | ||
parent::__construct($data, $context); | ||
$this->setAction('changeInputHint'); | ||
} | ||
|
||
/** | ||
* @param string $attributeName | ||
* @param string $inputHint | ||
* @param Context|callable $context | ||
* @return ProductTypeChangeInputHintAction | ||
*/ | ||
public static function ofAttributeNameAndInputHint($attributeName, $inputHint, $context = null) | ||
{ | ||
return static::of($context)->setAttributeName($attributeName)->setNewValue($inputHint); | ||
} | ||
} |
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