Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
feat(ProductType): add inputTip to attribute definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Schulze committed Mar 9, 2016
1 parent 32d182f commit 09288a4
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Model/ProductType/AttributeDefinition.php
Expand Up @@ -25,6 +25,8 @@
* @method AttributeDefinition setInputHint(string $inputHint = null)
* @method bool getIsSearchable()
* @method AttributeDefinition setIsSearchable(bool $isSearchable = null)
* @method LocalizedString getInputTip()
* @method AttributeDefinition setInputTip(LocalizedString $inputTip = null)
*/
class AttributeDefinition extends JsonObject
{
Expand All @@ -38,6 +40,7 @@ public function fieldDefinitions()
'attributeConstraint' => [static::TYPE => 'string'],
'inputHint' => [static::TYPE => 'string'],
'isSearchable' => [static::TYPE => 'bool'],
'inputTip' => [static::TYPE => '\Commercetools\Core\Model\Common\LocalizedString'],
];
}
}
52 changes: 52 additions & 0 deletions src/Request/ProductTypes/Command/ProductTypeSetInputTipAction.php
@@ -0,0 +1,52 @@
<?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 http://dev.commercetools.com/http-api-projects-productTypes.html#set-attribute-definition-inputtip
* @method string getAction()
* @method ProductTypeSetInputTipAction setAction(string $action = null)
* @method string getAttributeName()
* @method ProductTypeSetInputTipAction setAttributeName(string $attributeName = null)
* @method LocalizedString getInputTip()
* @method ProductTypeSetInputTipAction setInputTip(LocalizedString $inputTip = null)
*/
class ProductTypeSetInputTipAction extends AbstractAction
{
public function fieldDefinitions()
{
return [
'action' => [static::TYPE => 'string'],
'attributeName' => [static::TYPE => 'string'],
'inputTip' => [static::TYPE => '\Commercetools\Core\Model\Common\LocalizedString']
];
}

/**
* @param array $data
* @param Context|callable $context
*/
public function __construct(array $data = [], $context = null)
{
parent::__construct($data, $context);
$this->setAction('setInputTip');
}

/**
* @param string $attributeName
* @param Context|callable $context
* @return static
*/
public static function ofAttributeName($attributeName, $context = null)
{
return static::of($context)->setAttributeName($attributeName);
}
}
1 change: 1 addition & 0 deletions tests/fixtures/models.yaml
Expand Up @@ -740,6 +740,7 @@ attributeDefinition:
- attributeConstraint
- inputHint
- isSearchable
- inputTip

attributeType:
domain: productType
Expand Down

0 comments on commit 09288a4

Please sign in to comment.