Skip to content

Commit 38b31fc

Browse files
authored
Merge pull request #282 from whobutsb/feature/api-deprecations-query
Feature - Added API Deprecations Resource
2 parents b815f08 + 676aaaf commit 38b31fc

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ Some resources are available directly, some resources are only available through
321321
> Use the resources only by listed resource map. Trying to get a resource directly which is only available through parent resource may end up with errors.
322322
323323
- [AbandonedCheckout](https://help.shopify.com/api/reference/abandoned_checkouts)
324+
- [ApiDeprecations](https://shopify.dev/api/admin-rest/2022-04/resources/deprecated-api-calls#get-deprecated-api-calls)
324325
- [ApplicationCharge](https://help.shopify.com/api/reference/applicationcharge)
325326
- [Blog](https://help.shopify.com/api/reference/blog/)
326327
- Blog -> [Article](https://help.shopify.com/api/reference/article/)

lib/ApiDeprecations.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <tareqtms@yahoo.com>
5+
* @author Steve Barbera <whobutsb@gmail.com>
6+
* Created at 8/18/16 3:39 PM UTC+06:00
7+
*
8+
* @see https://shopify.dev/api/admin-rest/2022-04/resources/deprecated-api-calls#get-deprecated-api-calls Shopify API Reference for API Deprecations
9+
*/
10+
11+
namespace PHPShopify;
12+
13+
14+
class ApiDeprecations extends ShopifyResource
15+
{
16+
/**
17+
* @inheritDoc
18+
*/
19+
protected $resourceKey = 'deprecated_api_calls';
20+
21+
/**
22+
* @inheritDoc
23+
*/
24+
public $readOnly = true;
25+
26+
/**
27+
* @inheritDoc
28+
*/
29+
public $countEnabled = false;
30+
31+
/**
32+
* @inheritDoc
33+
*/
34+
public function pluralizeKey()
35+
{
36+
//Only api deprecations, so no pluralize
37+
return 'deprecated_api_calls';
38+
}
39+
}

lib/ShopifySDK.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
/**
7070
* @property-read AbandonedCheckout $AbandonedCheckout
7171
* @property-read AccessScope $AccessScope
72+
* @property-read ApiDeprecations $ApiDeprecations
7273
* @property-read ApplicationCharge $ApplicationCharge
7374
* @property-read Blog $Blog
7475
* @property-read CarrierService $CarrierService
@@ -116,6 +117,7 @@
116117
*
117118
* @method AbandonedCheckout AbandonedCheckout(integer $id = null)
118119
* @method AccessScope AccessScope()
120+
* @method ApiDeprecations ApiDeprecations()
119121
* @method ApplicationCharge ApplicationCharge(integer $id = null)
120122
* @method Blog Blog(integer $id = null)
121123
* @method CarrierService CarrierService(integer $id = null)
@@ -172,6 +174,7 @@ class ShopifySDK
172174
protected $resources = array(
173175
'AbandonedCheckout',
174176
'AccessScope',
177+
'ApiDeprecations',
175178
'ApplicationCharge',
176179
'Blog',
177180
'CarrierService',

0 commit comments

Comments
 (0)