Skip to content

Commit a8511a4

Browse files
committed
Metafield as a child resource
1 parent b57f835 commit a8511a4

File tree

7 files changed

+34
-1
lines changed

7 files changed

+34
-1
lines changed

lib/Blog.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
* --------------------------------------------------------------------------
1616
* @property-read ShopifyAPI $Article
1717
* @property-read ShopifyAPI $Event
18+
* @property-read ShopifyAPI $Metafield
1819
*
1920
* @method ShopifyAPI Article(integer $id = null)
2021
* @method ShopifyAPI Event(integer $id = null)
22+
* @method ShopifyAPI Metafield(integer $id = null)
2123
*
2224
*/
2325
class Blog extends ShopifyAPI
@@ -33,5 +35,6 @@ class Blog extends ShopifyAPI
3335
protected $childResource = array(
3436
'Article',
3537
'Event',
38+
'Metafield',
3639
);
3740
}

lib/CustomCollection.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
* CustomCollection -> Child Resources
1616
* --------------------------------------------------------------------------
1717
* @property-read ShopifyAPI $Event
18+
* @property-read ShopifyAPI $Metafield
1819
*
1920
* @method ShopifyAPI Event(integer $id = null)
21+
* @method ShopifyAPI Metafield(integer $id = null)
2022
*
2123
*/
2224
class CustomCollection extends ShopifyAPI
@@ -31,5 +33,6 @@ class CustomCollection extends ShopifyAPI
3133
*/
3234
protected $childResource = array(
3335
'Event',
36+
'Metafield',
3437
);
3538
}

lib/Customer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
* Customer -> Child Resources
1616
* --------------------------------------------------------------------------
1717
* @property-read ShopifyAPI $Address
18+
* @property-read ShopifyAPI $Metafield
1819
*
1920
* @method ShopifyAPI Address(integer $id = null)
21+
* @method ShopifyAPI Metafield(integer $id = null)
2022
*
2123
*/
2224
class Customer extends ShopifyAPI
@@ -35,6 +37,7 @@ class Customer extends ShopifyAPI
3537
* @inheritDoc
3638
*/
3739
protected $childResource = array(
38-
'CustomerAddress' => 'Address'
40+
'CustomerAddress' => 'Address',
41+
'Metafield',
3942
);
4043
}

lib/Event.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Created by PhpStorm.
44
* @author Tareq Mahmood <tareqtms@yahoo.com>
55
* Created at: 8/21/16 8:39 AM UTC+06:00
6+
*
7+
* @see https://help.shopify.com/api/reference/event/ Shopify API Reference for Event
68
*/
79

810
namespace PHPShopify;

lib/Order.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020
* @property-read ShopifyAPI $Refund
2121
* @property-read ShopifyAPI $Transaction
2222
* @property-read ShopifyAPI $Event
23+
* @property-read ShopifyAPI $Metafield
2324
*
2425
* @method ShopifyAPI Fulfillment(integer $id = null)
2526
* @method ShopifyAPI Risk(integer $id = null)
2627
* @method ShopifyAPI Refund(integer $id = null)
2728
* @method ShopifyAPI Transaction(integer $id = null)
2829
* @method ShopifyAPI Event(integer $id = null)
30+
* @method ShopifyAPI Metafield(integer $id = null)
2931
*
3032
*/
3133
class Order extends ShopifyAPI
@@ -44,5 +46,6 @@ class Order extends ShopifyAPI
4446
'Refund',
4547
'Transaction',
4648
'Event',
49+
'Metafield',
4750
);
4851
}

lib/Page.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
* Page -> Child Resources
1616
* --------------------------------------------------------------------------
1717
* @property-read ShopifyAPI $Event
18+
* @property-read ShopifyAPI $Metafield
1819
*
1920
* @method ShopifyAPI Event(integer $id = null)
21+
* @method ShopifyAPI Metafield(integer $id = null)
2022
*
2123
*/
2224
class Page extends ShopifyAPI
@@ -31,5 +33,6 @@ class Page extends ShopifyAPI
3133
*/
3234
protected $childResource = array(
3335
'Event',
36+
'Metafield',
3437
);
3538
}

lib/ProductVariant.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,26 @@
1010
namespace PHPShopify;
1111

1212

13+
/*
14+
* --------------------------------------------------------------------------
15+
* ProductVariant -> Child Resources
16+
* --------------------------------------------------------------------------
17+
* @property-read ShopifyAPI $Metafield
18+
*
19+
* @method ShopifyAPI Metafield(integer $id = null)
20+
*
21+
*/
1322
class ProductVariant extends ShopifyAPI
1423
{
1524
/**
1625
* @inheritDoc
1726
*/
1827
protected $resourceKey = 'variant';
28+
29+
/**
30+
* @inheritDoc
31+
*/
32+
protected $childResource = array(
33+
'Metafield',
34+
);
1935
}

0 commit comments

Comments
 (0)