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

CartDiscountReference   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\CartDiscount;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Model\Common\Reference;
10
11
/**
12
 * @package Commercetools\Core\Model\CartDiscount
13
 * @link https://dev.commercetools.com/http-api-types.html#reference-types
14
 * @link https://dev.commercetools.com/http-api-projects-cartDiscounts.html#cart-discount
15
 * @method string getTypeId()
16
 * @method CartDiscountReference setTypeId(string $typeId = null)
17
 * @method string getId()
18
 * @method CartDiscountReference setId(string $id = null)
19
 * @method CartDiscount getObj()
20
 * @method CartDiscountReference setObj(CartDiscount $obj = null)
21
 * @method string getKey()
22
 * @method CartDiscountReference setKey(string $key = null)
23
 */
24
class CartDiscountReference extends Reference
25
{
26
    const TYPE_CART_DISCOUNT = 'cart-discount';
27
    const TYPE_CLASS = '\Commercetools\Core\Model\CartDiscount\CartDiscount';
28
29
    /**
30
     * @param $id
31
     * @param Context|callable $context
32
     * @return CartDiscountReference
33
     */
34 15
    public static function ofId($id, $context = null)
35
    {
36 15
        return static::ofTypeAndId(static::TYPE_CART_DISCOUNT, $id, $context);
37
    }
38
}
39