diff --git a/lib/Collection.php b/lib/Collection.php new file mode 100644 index 0000000..1d2c84a --- /dev/null +++ b/lib/Collection.php @@ -0,0 +1,35 @@ + Child Resources + * -------------------------------------------------------------------------- + * + * @property-read Product $Product + * + * @method Product Product(integer $id = null) + * + * @see https://shopify.dev/docs/admin-api/rest/reference/products/collection + * + */ +class Collection extends ShopifyResource +{ + /** + * @inheritDoc + */ + public $readOnly = false; + + /** + * @inheritDoc + */ + protected $resourceKey = 'collection'; + + /** + * @inheritDoc + */ + protected $childResource = array( + 'Product', + ); +} \ No newline at end of file diff --git a/lib/ShopifyResource.php b/lib/ShopifyResource.php index 1b021d6..f9940be 100644 --- a/lib/ShopifyResource.php +++ b/lib/ShopifyResource.php @@ -599,8 +599,6 @@ public function getUrlParams($url) { public function getNextPageParams(){ $nextPageParams = []; - $nextPageLink = - parse_str($this->getUrlParams($this->getNextLink()), $nextPageParams); return $nextPageParams; } diff --git a/lib/ShopifySDK.php b/lib/ShopifySDK.php index 7fab8c2..e6e66f5 100644 --- a/lib/ShopifySDK.php +++ b/lib/ShopifySDK.php @@ -71,6 +71,7 @@ * @property-read Blog $Blog * @property-read CarrierService $CarrierService * @property-read Collect $Collect + * @property-read Collection $Collection * @property-read Comment $Comment * @property-read Country $Country * @property-read Currency $Currency @@ -110,6 +111,7 @@ * @method Blog Blog(integer $id = null) * @method CarrierService CarrierService(integer $id = null) * @method Collect Collect(integer $id = null) + * @method Collection Collection(integer $id = null) * @method Comment Comment(integer $id = null) * @method Country Country(integer $id = null) * @method Currency Currency(integer $id = null) @@ -158,6 +160,7 @@ class ShopifySDK 'Blog', 'CarrierService', 'Collect', + 'Collection', 'Comment', 'Country', 'Currency', diff --git a/tests/CollectionTest.php b/tests/CollectionTest.php new file mode 100644 index 0000000..da7ef9d --- /dev/null +++ b/tests/CollectionTest.php @@ -0,0 +1,16 @@ +