Skip to content

Commit 8ca30ce

Browse files
committed
Event resource added
1 parent 1404d12 commit 8ca30ce

File tree

10 files changed

+126
-1
lines changed

10 files changed

+126
-1
lines changed

lib/Article.php

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

1212

13+
/*
14+
* --------------------------------------------------------------------------
15+
* Article -> Child Resources
16+
* --------------------------------------------------------------------------
17+
* @property-read ShopifyAPI $Event
18+
*
19+
* @method ShopifyAPI Event(integer $id = null)
20+
*
21+
*/
1322
class Article extends ShopifyAPI
1423
{
1524
/**
@@ -18,4 +27,15 @@ class Article extends ShopifyAPI
1827
* @var string
1928
*/
2029
protected $resourceKey = 'article';
30+
31+
/**
32+
* List of child Resource names / classes
33+
* If any array item has an associative key => value pair, value will be considered as the resource name
34+
* (by which it will be called) and key will be the associated class name.
35+
*
36+
* @var array
37+
*/
38+
protected $childResource = array(
39+
'Event',
40+
);
2141
}

lib/Blog.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
* Blog -> Child Resources
1515
* --------------------------------------------------------------------------
1616
* @property-read ShopifyAPI $Article
17+
* @property-read ShopifyAPI $Event
1718
*
1819
* @method ShopifyAPI Article(integer $id = null)
20+
* @method ShopifyAPI Event(integer $id = null)
1921
*
2022
*/
2123
class Blog extends ShopifyAPI
@@ -36,5 +38,6 @@ class Blog extends ShopifyAPI
3638
*/
3739
protected $childResource = array(
3840
'Article',
41+
'Event',
3942
);
4043
}

lib/Comment.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111

1212

1313
/*
14+
*
15+
* --------------------------------------------------------------------------
16+
* Comment -> Child Resources
17+
* --------------------------------------------------------------------------
18+
* @property-read ShopifyAPI $Event
19+
*
20+
* @method ShopifyAPI Event(integer $id = null)
21+
*
1422
* --------------------------------------------------------------------------
1523
* Comment -> Custom actions
1624
* --------------------------------------------------------------------------
@@ -30,6 +38,17 @@ class Comment extends ShopifyAPI
3038
*/
3139
protected $resourceKey = 'comment';
3240

41+
/**
42+
* List of child Resource names / classes
43+
* If any array item has an associative key => value pair, value will be considered as the resource name
44+
* (by which it will be called) and key will be the associated class name.
45+
*
46+
* @var array
47+
*/
48+
protected $childResource = array (
49+
'Event',
50+
);
51+
3352
/**
3453
* List of custom POST actions
3554
* @example: ['enable', 'disable', 'remove','default' => 'makeDefault']

lib/CustomCollection.php

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

1212

13+
/*
14+
* --------------------------------------------------------------------------
15+
* CustomCollection -> Child Resources
16+
* --------------------------------------------------------------------------
17+
* @property-read ShopifyAPI $Event
18+
*
19+
* @method ShopifyAPI Event(integer $id = null)
20+
*
21+
*/
1322
class CustomCollection extends ShopifyAPI
1423
{
1524
/**
@@ -18,4 +27,15 @@ class CustomCollection extends ShopifyAPI
1827
* @var string
1928
*/
2029
protected $resourceKey = 'custom_collection';
30+
31+
/**
32+
* List of child Resource names / classes
33+
* If any array item has an associative key => value pair, value will be considered as the resource name
34+
* (by which it will be called) and key will be the associated class name.
35+
*
36+
* @var array
37+
*/
38+
protected $childResource = array(
39+
'Event',
40+
);
2141
}

lib/CustomerAddress.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected function pluralizeKey()
5757
*
5858
* @return array
5959
*/
60-
//TODO Issue (Api Error) : Internal server error
60+
//TODO Issue (Getting Error from API) : Internal server error
6161
public function set($params)
6262
{
6363
$url = $this->generateUrl($params, 'set');

lib/Event.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <tareqtms@yahoo.com>
5+
* Created at: 8/21/16 8:39 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class Event extends ShopifyAPI
12+
{
13+
/**
14+
* Key of the API Resource which is used to fetch data from request responses
15+
*
16+
* @var string
17+
*/
18+
protected $resourceKey = 'event';
19+
}

lib/Order.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919
* @property-read ShopifyAPI $Risk
2020
* @property-read ShopifyAPI $Refund
2121
* @property-read ShopifyAPI $Transaction
22+
* @property-read ShopifyAPI $Event
2223
*
2324
* @method ShopifyAPI Fulfillment(integer $id = null)
2425
* @method ShopifyAPI Risk(integer $id = null)
2526
* @method ShopifyAPI Refund(integer $id = null)
2627
* @method ShopifyAPI Transaction(integer $id = null)
28+
* @method ShopifyAPI Event(integer $id = null)
2729
*
2830
*/
2931
class Order extends ShopifyAPI
@@ -47,5 +49,6 @@ class Order extends ShopifyAPI
4749
'OrderRisk' => 'Risk',
4850
'Refund',
4951
'Transaction',
52+
'Event',
5053
);
5154
}

lib/Page.php

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

1212

13+
/*
14+
* --------------------------------------------------------------------------
15+
* Page -> Child Resources
16+
* --------------------------------------------------------------------------
17+
* @property-read ShopifyAPI $Event
18+
*
19+
* @method ShopifyAPI Event(integer $id = null)
20+
*
21+
*/
1322
class Page extends ShopifyAPI
1423
{
1524
/**
@@ -18,4 +27,15 @@ class Page extends ShopifyAPI
1827
* @var string
1928
*/
2029
protected $resourceKey = 'page';
30+
31+
/**
32+
* List of child Resource names / classes
33+
* If any array item has an associative key => value pair, value will be considered as the resource name
34+
* (by which it will be called) and key will be the associated class name.
35+
*
36+
* @var array
37+
*/
38+
protected $childResource = array(
39+
'Event',
40+
);
2141
}

lib/Product.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
* @property-read ShopifyAPI $Image
1818
* @property-read ShopifyAPI $Variant
1919
* @property-read ShopifyAPI $Metafield
20+
* @property-read ShopifyAPI $Event
2021
*
2122
* @method ShopifyAPI Image(integer $id = null)
2223
* @method ShopifyAPI Variant(integer $id = null)
2324
* @method ShopifyAPI Metafield(integer $id = null)
25+
* @method ShopifyAPI Event(integer $id = null)
2426
*
2527
*/
2628
class Product extends ShopifyAPI
@@ -43,5 +45,6 @@ class Product extends ShopifyAPI
4345
'ProductImage' => 'Image',
4446
'ProductVariant' => 'Variant',
4547
'Metafield',
48+
'Event'
4649
);
4750
}

lib/SmartCollection.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111

1212

1313
/*
14+
* --------------------------------------------------------------------------
15+
* SmartCollection -> Child Resources
16+
* --------------------------------------------------------------------------
17+
* @property-read ShopifyAPI $Event
18+
*
19+
* @method ShopifyAPI Event(integer $id = null)
20+
*
1421
* --------------------------------------------------------------------------
1522
* SmartCollection -> Custom actions
1623
* --------------------------------------------------------------------------
@@ -26,6 +33,17 @@ class SmartCollection extends ShopifyAPI
2633
*/
2734
protected $resourceKey = 'smart_collection';
2835

36+
/**
37+
* List of child Resource names / classes
38+
* If any array item has an associative key => value pair, value will be considered as the resource name
39+
* (by which it will be called) and key will be the associated class name.
40+
*
41+
* @var array
42+
*/
43+
protected $childResource = array(
44+
'Event',
45+
);
46+
2947
/**
3048
* Set the ordering type and/or the manual order of products in a smart collection
3149
*

0 commit comments

Comments
 (0)