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

ShippingMethodReference::fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Code Coverage

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