@@ 25-49 (lines=25) @@ | ||
22 | * @method string getKey() |
|
23 | * @method ChannelReference setKey(string $key = null) |
|
24 | */ |
|
25 | class ChannelReference extends Reference |
|
26 | { |
|
27 | const TYPE_CHANNEL = 'channel'; |
|
28 | const TYPE_CLASS = Channel::class; |
|
29 | ||
30 | /** |
|
31 | * @param $id |
|
32 | * @param Context|callable $context |
|
33 | * @return ChannelReference |
|
34 | */ |
|
35 | public static function ofId($id, $context = null) |
|
36 | { |
|
37 | return static::ofTypeAndId(static::TYPE_CHANNEL, $id, $context); |
|
38 | } |
|
39 | ||
40 | /** |
|
41 | * @param $key |
|
42 | * @param Context|callable $context |
|
43 | * @return ChannelReference |
|
44 | */ |
|
45 | public static function ofKey($key, $context = null) |
|
46 | { |
|
47 | return static::ofTypeAndKey(static::TYPE_CHANNEL, $key, $context); |
|
48 | } |
|
49 | } |
|
50 |
@@ 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 = ProductType::class; |
|
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 |
@@ 24-48 (lines=25) @@ | ||
21 | * @method string getKey() |
|
22 | * @method ShoppingListReference setKey(string $key = null) |
|
23 | */ |
|
24 | class ShoppingListReference extends Reference |
|
25 | { |
|
26 | const TYPE_SHOPPING_LIST = 'shopping-list'; |
|
27 | const TYPE_CLASS = ShoppingList::class; |
|
28 | ||
29 | /** |
|
30 | * @param $id |
|
31 | * @param Context|callable $context |
|
32 | * @return ShoppingListReference |
|
33 | */ |
|
34 | public static function ofId($id, $context = null) |
|
35 | { |
|
36 | return static::ofTypeAndId(static::TYPE_SHOPPING_LIST, $id, $context); |
|
37 | } |
|
38 | ||
39 | /** |
|
40 | * @param $key |
|
41 | * @param Context|callable $context |
|
42 | * @return ShoppingListReference |
|
43 | */ |
|
44 | public static function ofKey($key, $context = null) |
|
45 | { |
|
46 | return static::ofTypeAndKey(static::TYPE_SHOPPING_LIST, $key, $context); |
|
47 | } |
|
48 | } |
|
49 |
@@ 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 = State::class; |
|
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 = Subscription::class; |
|
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 |
@@ 25-49 (lines=25) @@ | ||
22 | * @method string getKey() |
|
23 | * @method TypeReference setKey(string $key = null) |
|
24 | */ |
|
25 | class TypeReference extends Reference |
|
26 | { |
|
27 | const TYPE_TYPE = 'type'; |
|
28 | const TYPE_CLASS = Type::class; |
|
29 | ||
30 | /** |
|
31 | * @param $id |
|
32 | * @param Context|callable $context |
|
33 | * @return TypeReference |
|
34 | */ |
|
35 | public static function ofId($id, $context = null) |
|
36 | { |
|
37 | return static::ofTypeAndId(static::TYPE_TYPE, $id, $context); |
|
38 | } |
|
39 | ||
40 | /** |
|
41 | * @param $key |
|
42 | * @param Context|callable $context |
|
43 | * @return TypeReference |
|
44 | */ |
|
45 | public static function ofKey($key, $context = null) |
|
46 | { |
|
47 | return static::ofTypeAndKey(static::TYPE_TYPE, $key, $context); |
|
48 | } |
|
49 | } |
|
50 |