Completed
Push — master ( 4b89b9...dd9abc )
by Jens
10:35
created

DiscountCodeReference   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 15
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A ofId() 0 4 1
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Model\DiscountCode;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Model\Common\Reference;
10
11
/**
12
 * @package Commercetools\Core\Model\DiscountCode
13
 * @link https://dev.commercetools.com/http-api-types.html#reference-types
14
 * @link https://dev.commercetools.com/http-api-projects-discountCodes.html#discount-code
15
 * @method string getTypeId()
16
 * @method DiscountCodeReference setTypeId(string $typeId = null)
17
 * @method string getId()
18
 * @method DiscountCodeReference setId(string $id = null)
19
 * @method DiscountCode getObj()
20
 * @method DiscountCodeReference setObj(DiscountCode $obj = null)
21
 * @method string getKey()
22
 * @method DiscountCodeReference setKey(string $key = null)
23
 */
24
class DiscountCodeReference extends Reference
25
{
26
    const TYPE_DISCOUNT_CODE = 'discount-code';
27
    const TYPE_CLASS = '\Commercetools\Core\Model\DiscountCode\DiscountCode';
28
29
    /**
30
     * @param $id
31
     * @param Context|callable $context
32
     * @return DiscountCodeReference
33
     */
34 5
    public static function ofId($id, $context = null)
35
    {
36 5
        return static::ofTypeAndId(static::TYPE_DISCOUNT_CODE, $id, $context);
37
    }
38
}
39