Passed
Push — develop ( a5b804...8edde8 )
by Jens
22:28 queued 09:47
created

TaxCategoryReference::ofKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 2
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