Skip to content

Added the Collection resource #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions lib/Collection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace PHPShopify;

/**
* --------------------------------------------------------------------------
* Collection -> 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',
);
}
3 changes: 3 additions & 0 deletions lib/ShopifySDK.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -158,6 +160,7 @@ class ShopifySDK
'Blog',
'CarrierService',
'Collect',
'Collection',
'Comment',
'Country',
'Currency',
Expand Down
8 changes: 8 additions & 0 deletions tests/CollectionTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace PHPShopify;

class CollectionTest extends TestSimpleResource
{

}