@@ 25-49 (lines=25) @@ | ||
22 | * @method string getKey() |
|
23 | * @method ProductTypeReference setKey(string $key = null) |
|
24 | */ |
|
25 | class ProductTypeReference extends Reference |
|
26 | { |
|
27 | const TYPE_PRODUCT_TYPE = 'product-type'; |
|
28 | const TYPE_CLASS = '\Commercetools\Core\Model\ProductType\ProductType'; |
|
29 | ||
30 | /** |
|
31 | * @param $id |
|
32 | * @param Context|callable $context |
|
33 | * @return ProductTypeReference |
|
34 | */ |
|
35 | public static function ofId($id, $context = null) |
|
36 | { |
|
37 | return static::ofTypeAndId(static::TYPE_PRODUCT_TYPE, $id, $context); |
|
38 | } |
|
39 | ||
40 | /** |
|
41 | * @param $key |
|
42 | * @param Context|callable $context |
|
43 | * @return ProductTypeReference |
|
44 | */ |
|
45 | public static function ofKey($key, $context = null) |
|
46 | { |
|
47 | return static::ofTypeAndKey(static::TYPE_PRODUCT_TYPE, $key, $context); |
|
48 | } |
|
49 | } |
|
50 |
@@ 25-49 (lines=25) @@ | ||
22 | * @method string getKey() |
|
23 | * @method StateReference setKey(string $key = null) |
|
24 | */ |
|
25 | class StateReference extends Reference |
|
26 | { |
|
27 | const TYPE_STATE = 'state'; |
|
28 | const TYPE_CLASS = '\Commercetools\Core\Model\State\State'; |
|
29 | ||
30 | /** |
|
31 | * @param $id |
|
32 | * @param Context|callable $context |
|
33 | * @return StateReference |
|
34 | */ |
|
35 | public static function ofId($id, $context = null) |
|
36 | { |
|
37 | return static::ofTypeAndId(static::TYPE_STATE, $id, $context); |
|
38 | } |
|
39 | ||
40 | /** |
|
41 | * @param $key |
|
42 | * @param Context|callable $context |
|
43 | * @return StateReference |
|
44 | */ |
|
45 | public static function ofKey($key, $context = null) |
|
46 | { |
|
47 | return static::ofTypeAndKey(static::TYPE_STATE, $key, $context); |
|
48 | } |
|
49 | } |
|
50 |
@@ 25-49 (lines=25) @@ | ||
22 | * @method Subscription getObj() |
|
23 | * @method SubscriptionReference setObj(Subscription $obj = null) |
|
24 | */ |
|
25 | class SubscriptionReference extends Reference |
|
26 | { |
|
27 | const TYPE_SUBSCRIPTION = 'subscription'; |
|
28 | const TYPE_CLASS = '\Commercetools\Core\Model\Subscription\Subscription'; |
|
29 | ||
30 | /** |
|
31 | * @param $id |
|
32 | * @param Context|callable $context |
|
33 | * @return SubscriptionReference |
|
34 | */ |
|
35 | public static function ofId($id, $context = null) |
|
36 | { |
|
37 | return static::ofTypeAndId(static::TYPE_SUBSCRIPTION, $id, $context); |
|
38 | } |
|
39 | ||
40 | /** |
|
41 | * @param $key |
|
42 | * @param Context|callable $context |
|
43 | * @return SubscriptionReference |
|
44 | */ |
|
45 | public static function ofKey($key, $context = null) |
|
46 | { |
|
47 | return static::ofTypeAndKey(static::TYPE_SUBSCRIPTION, $key, $context); |
|
48 | } |
|
49 | } |
|
50 |