Skip to content

Commit a7a06c6

Browse files
authored
Merge pull request #1 from phpclassic/master
Update master.
2 parents 636ecf2 + c232b69 commit a7a06c6

File tree

4 files changed

+54
-2
lines changed

4 files changed

+54
-2
lines changed

lib/Collection.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace PHPShopify;
4+
5+
/**
6+
* --------------------------------------------------------------------------
7+
* Collection -> Child Resources
8+
* --------------------------------------------------------------------------
9+
*
10+
* @property-read Product $Product
11+
*
12+
* @method Product Product(integer $id = null)
13+
*
14+
* @see https://shopify.dev/docs/admin-api/rest/reference/products/collection
15+
*
16+
*/
17+
class Collection extends ShopifyResource
18+
{
19+
/**
20+
* @inheritDoc
21+
*/
22+
public $readOnly = false;
23+
24+
/**
25+
* @inheritDoc
26+
*/
27+
protected $resourceKey = 'collection';
28+
29+
/**
30+
* @inheritDoc
31+
*/
32+
protected $childResource = array(
33+
'Product',
34+
);
35+
}

lib/ShopifyResource.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,6 @@ public function getUrlParams($url) {
599599

600600
public function getNextPageParams(){
601601
$nextPageParams = [];
602-
$nextPageLink =
603-
604602
parse_str($this->getUrlParams($this->getNextLink()), $nextPageParams);
605603
return $nextPageParams;
606604
}

lib/ShopifySDK.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
* @property-read Blog $Blog
7272
* @property-read CarrierService $CarrierService
7373
* @property-read Collect $Collect
74+
* @property-read Collection $Collection
7475
* @property-read Comment $Comment
7576
* @property-read Country $Country
7677
* @property-read Currency $Currency
@@ -110,6 +111,7 @@
110111
* @method Blog Blog(integer $id = null)
111112
* @method CarrierService CarrierService(integer $id = null)
112113
* @method Collect Collect(integer $id = null)
114+
* @method Collection Collection(integer $id = null)
113115
* @method Comment Comment(integer $id = null)
114116
* @method Country Country(integer $id = null)
115117
* @method Currency Currency(integer $id = null)
@@ -158,6 +160,7 @@ class ShopifySDK
158160
'Blog',
159161
'CarrierService',
160162
'Collect',
163+
'Collection',
161164
'Comment',
162165
'Country',
163166
'Currency',

tests/CollectionTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace PHPShopify;
4+
5+
class CollectionTest extends TestSimpleResource
6+
{
7+
/**
8+
* Test get resource
9+
*
10+
* Post and list not available for Collection resource so testGet not possible
11+
*/
12+
public function testGet()
13+
{
14+
15+
}
16+
}

0 commit comments

Comments
 (0)