Skip to content

Commit f06d5dd

Browse files
committed
Disable count() for resources for which API doesn't support count
1 parent 42d9f00 commit f06d5dd

13 files changed

+60
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ $shopify->Customer->search("Bob country:United States");
319319
#### Custom Actions List
320320
The custom methods are specific to some resources which may not be available for other resources. It is recommended that you see the details in the related Shopify API Reference page about each action. We will just list the available actions here with some brief info. each action name is linked to an example in Shopify API Reference which has more details information.
321321

322-
- _(Any resource type)_ ->
322+
- _(Any resource type except ApplicationCharge, CarrierService, FulfillmentService, Location, Policy, RecurringApplicationCharge, ShippingZone, Shop, Theme)_ ->
323323
- [count()](https://help.shopify.com/api/reference/product#count)
324324
Get a count of all the resources.
325325
Unlike all other actions, this function returns an integer value.

lib/ApplicationCharge.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ class ApplicationCharge extends ShopifyResource
1616
* @inheritDoc
1717
*/
1818
protected $resourceKey = 'application_charge';
19+
20+
/**
21+
* @inheritDoc
22+
*/
23+
public $countEnabled = false;
1924
}

lib/CarrierService.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ class CarrierService extends ShopifyResource
1616
* @inheritDoc
1717
*/
1818
protected $resourceKey = 'carrier_service';
19+
20+
/**
21+
* @inheritDoc
22+
*/
23+
public $countEnabled = false;
1924
}

lib/Customer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Customer extends ShopifyResource
3434
/**
3535
* @inheritDoc
3636
*/
37-
protected $searchEnabled = true;
37+
public $searchEnabled = true;
3838

3939
/**
4040
* @inheritDoc

lib/FulfillmentService.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ class FulfillmentService extends ShopifyResource
1616
* @inheritDoc
1717
*/
1818
protected $resourceKey = 'fulfillment_service';
19+
20+
/**
21+
* @inheritDoc
22+
*/
23+
public $countEnabled = false;
1924
}

lib/GiftCard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class GiftCard extends ShopifyResource
2828
/**
2929
* @inheritDoc
3030
*/
31-
protected $searchEnabled = true;
31+
public $searchEnabled = true;
3232

3333
/**
3434
* Disable a gift card.

lib/Location.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ class Location extends ShopifyResource
1717
*/
1818
protected $resourceKey = 'location';
1919

20+
/**
21+
* @inheritDoc
22+
*/
23+
public $countEnabled = false;
24+
2025
/**
2126
* @inheritDoc
2227
*/

lib/Policy.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ class Policy extends ShopifyResource
1717
*/
1818
protected $resourceKey = 'policy';
1919

20+
/**
21+
* @inheritDoc
22+
*/
23+
public $countEnabled = false;
24+
2025
/**
2126
* @inheritDoc
2227
*/

lib/RecurringApplicationCharge.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ class RecurringApplicationCharge extends ShopifyResource
3232
*/
3333
protected $resourceKey = 'recurring_application_charge';
3434

35+
/**
36+
* @inheritDoc
37+
*/
38+
public $countEnabled = false;
39+
3540
/**
3641
* @inheritDoc
3742
*/

lib/ShippingZone.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ class ShippingZone extends ShopifyResource
1717
*/
1818
protected $resourceKey = 'shipping_zone';
1919

20+
/**
21+
* @inheritDoc
22+
*/
23+
public $countEnabled = false;
24+
2025
/**
2126
* @inheritDoc
2227
*/

0 commit comments

Comments
 (0)