From 1816de456de3b36c9ecebbbd12ab36581e2bdacf Mon Sep 17 00:00:00 2001 From: Jin Date: Mon, 3 Oct 2022 21:01:43 +0700 Subject: [PATCH] Metafield as a child resource of Collection & DraftOrder --- lib/Collection.php | 5 ++++- lib/DraftOrder.php | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/Collection.php b/lib/Collection.php index 1d2c84a..0c21a40 100644 --- a/lib/Collection.php +++ b/lib/Collection.php @@ -8,8 +8,10 @@ * -------------------------------------------------------------------------- * * @property-read Product $Product + * @property-read Metafield $Metafield * * @method Product Product(integer $id = null) + * @method Metafield Metafield(integer $id = null) * * @see https://shopify.dev/docs/admin-api/rest/reference/products/collection * @@ -31,5 +33,6 @@ class Collection extends ShopifyResource */ protected $childResource = array( 'Product', + 'Metafield', ); -} \ No newline at end of file +} diff --git a/lib/DraftOrder.php b/lib/DraftOrder.php index 902cee5..9e3be91 100644 --- a/lib/DraftOrder.php +++ b/lib/DraftOrder.php @@ -12,6 +12,14 @@ /** + * -------------------------------------------------------------------------- + * DraftOrder -> Child Resources + * -------------------------------------------------------------------------- + * + * @property-read Metafield $Metafield + * + * @method Metafield Metafield(integer $id = null) + * * -------------------------------------------------------------------------- * DraftOrder -> Custom actions * -------------------------------------------------------------------------- @@ -39,4 +47,11 @@ class DraftOrder extends ShopifyResource protected $customPutActions = array( 'complete', ); -} \ No newline at end of file + + /** + * @inheritDoc + */ + protected $childResource = array( + 'Metafield', + ); +}