1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author @jenschude <[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://docs.commercetools.com/http-api-types.html#reference-types |
14
|
|
|
* @link https://docs.commercetools.com/http-api-projects-shippingMethods.html#shippingmethod |
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 = ShippingMethod::class; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @param $id |
31
|
|
|
* @param Context|callable $context |
32
|
|
|
* @return ShippingMethodReference |
33
|
|
|
*/ |
34
|
151 |
|
public static function ofId($id, $context = null) |
35
|
|
|
{ |
36
|
151 |
|
return static::ofTypeAndId(static::TYPE_SHIPPING_METHOD, $id, $context); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @param $key |
41
|
|
|
* @param Context|callable $context |
42
|
|
|
* @return ShippingMethodReference |
43
|
|
|
*/ |
44
|
|
|
public static function ofKey($key, $context = null) |
45
|
|
|
{ |
46
|
|
|
return static::ofTypeAndKey(static::TYPE_SHIPPING_METHOD, $key, $context); |
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
|