Completed
Push — develop ( 59e20d...68d263 )
by Jens
09:59
created

ProductDiscountReference::ofId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 1
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 * @created: 27.01.15, 18:22
5
 */
6
7
namespace Commercetools\Core\Model\ProductDiscount;
8
9
use Commercetools\Core\Model\Common\Context;
10
use Commercetools\Core\Model\Common\Reference;
11
12
/**
13
 * @package Commercetools\Core\Model\ProductDiscount
14
 * @link https://dev.commercetools.com/http-api-types.html#reference-types
15
 * @link https://dev.commercetools.com/http-api-projects-productDiscounts.html#product-discount
16
 * @method string getTypeId()
17
 * @method ProductDiscountReference setTypeId(string $typeId = null)
18
 * @method string getId()
19
 * @method ProductDiscountReference setId(string $id = null)
20
 * @method ProductDiscount getObj()
21
 * @method ProductDiscountReference setObj(ProductDiscount $obj = null)
22
 * @method string getKey()
23
 * @method ProductDiscountReference setKey(string $key = null)
24
 */
25
class ProductDiscountReference extends Reference
26
{
27
    const TYPE_PRODUCT_DISCOUNT = 'product-discount';
28
    const TYPE_CLASS = '\Commercetools\Core\Model\ProductDiscount\ProductDiscount';
29
30
    /**
31
     * @param $id
32
     * @param Context|callable $context
33
     * @return ProductDiscountReference
34
     */
35 4
    public static function ofId($id, $context = null)
36
    {
37 4
        return static::ofTypeAndId(static::TYPE_PRODUCT_DISCOUNT, $id, $context);
38
    }
39
}
40