1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author @jenschude <[email protected]> |
4
|
|
|
* @created: 27.01.15, 18:22 |
5
|
|
|
*/ |
6
|
|
|
|
7
|
|
|
namespace Commercetools\Core\Model\TaxCategory; |
8
|
|
|
|
9
|
|
|
use Commercetools\Core\Model\Common\Context; |
10
|
|
|
use Commercetools\Core\Model\Common\Reference; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* @package Commercetools\Core\Model\TaxCategory |
14
|
|
|
* @link https://docs.commercetools.com/http-api-types.html#reference-types |
15
|
|
|
* @link https://docs.commercetools.com/http-api-projects-taxCategories.html#taxcategory |
16
|
|
|
* @method string getTypeId() |
17
|
|
|
* @method TaxCategoryReference setTypeId(string $typeId = null) |
18
|
|
|
* @method string getId() |
19
|
|
|
* @method TaxCategoryReference setId(string $id = null) |
20
|
|
|
* @method TaxCategory getObj() |
21
|
|
|
* @method TaxCategoryReference setObj(TaxCategory $obj = null) |
22
|
|
|
* @method string getKey() |
23
|
|
|
* @method TaxCategoryReference setKey(string $key = null) |
24
|
|
|
*/ |
25
|
|
|
class TaxCategoryReference extends Reference |
26
|
|
|
{ |
27
|
|
|
const TYPE_TAX_CATEGORY = 'tax-category'; |
28
|
|
|
const TYPE_CLASS = TaxCategory::class; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @param $id |
32
|
|
|
* @param Context|callable $context |
33
|
|
|
* @return TaxCategoryReference |
34
|
|
|
*/ |
35
|
240 |
|
public static function ofId($id, $context = null) |
36
|
|
|
{ |
37
|
240 |
|
return static::ofTypeAndId(static::TYPE_TAX_CATEGORY, $id, $context); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @param $key |
42
|
|
|
* @param Context|callable $context |
43
|
|
|
* @return TaxCategoryReference |
44
|
|
|
*/ |
45
|
|
|
public static function ofKey($key, $context = null) |
46
|
|
|
{ |
47
|
|
|
return static::ofTypeAndKey(static::TYPE_TAX_CATEGORY, $key, $context); |
48
|
|
|
} |
49
|
|
|
} |
50
|
|
|
|