Skip to content

Commit

Permalink
Merge pull request #267 from nVuln/master
Browse files Browse the repository at this point in the history
Metafield as a child resource of Collection & DraftOrder
  • Loading branch information
tareqtms committed Oct 3, 2022
2 parents 3b6b023 + 1816de4 commit f931765
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -31,5 +33,6 @@ class Collection extends ShopifyResource
*/
protected $childResource = array(
'Product',
'Metafield',
);
}
}
17 changes: 16 additions & 1 deletion lib/DraftOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@


/**
* --------------------------------------------------------------------------
* DraftOrder -> Child Resources
* --------------------------------------------------------------------------
*
* @property-read Metafield $Metafield
*
* @method Metafield Metafield(integer $id = null)
*
* --------------------------------------------------------------------------
* DraftOrder -> Custom actions
* --------------------------------------------------------------------------
Expand Down Expand Up @@ -39,4 +47,11 @@ class DraftOrder extends ShopifyResource
protected $customPutActions = array(
'complete',
);
}

/**
* @inheritDoc
*/
protected $childResource = array(
'Metafield',
);
}

0 comments on commit f931765

Please sign in to comment.