Skip to content

Commit f931765

Browse files
authored
Merge pull request #267 from nVuln/master
Metafield as a child resource of Collection & DraftOrder
2 parents 3b6b023 + 1816de4 commit f931765

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

lib/Collection.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
* --------------------------------------------------------------------------
99
*
1010
* @property-read Product $Product
11+
* @property-read Metafield $Metafield
1112
*
1213
* @method Product Product(integer $id = null)
14+
* @method Metafield Metafield(integer $id = null)
1315
*
1416
* @see https://shopify.dev/docs/admin-api/rest/reference/products/collection
1517
*
@@ -31,5 +33,6 @@ class Collection extends ShopifyResource
3133
*/
3234
protected $childResource = array(
3335
'Product',
36+
'Metafield',
3437
);
35-
}
38+
}

lib/DraftOrder.php

+16-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212

1313

1414
/**
15+
* --------------------------------------------------------------------------
16+
* DraftOrder -> Child Resources
17+
* --------------------------------------------------------------------------
18+
*
19+
* @property-read Metafield $Metafield
20+
*
21+
* @method Metafield Metafield(integer $id = null)
22+
*
1523
* --------------------------------------------------------------------------
1624
* DraftOrder -> Custom actions
1725
* --------------------------------------------------------------------------
@@ -39,4 +47,11 @@ class DraftOrder extends ShopifyResource
3947
protected $customPutActions = array(
4048
'complete',
4149
);
42-
}
50+
51+
/**
52+
* @inheritDoc
53+
*/
54+
protected $childResource = array(
55+
'Metafield',
56+
);
57+
}

0 commit comments

Comments
 (0)