Skip to content

Commit aa35f44

Browse files
committed
add support for Order()->FulfillmentOrder and FulfillmentRequests
1 parent b815f08 commit aa35f44

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

lib/FulfillmentOrder.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* --------------------------------------------------------------------------
1515
* FulfillmentOrder -> Child Resources
1616
* --------------------------------------------------------------------------
17+
* @property-read FulfillmentRequest $FulfillmentRequest
1718
*
1819
* --------------------------------------------------------------------------
1920
* Fulfillment -> Custom actions
@@ -33,6 +34,12 @@ class FulfillmentOrder extends ShopifyResource
3334
*/
3435
protected $resourceKey = 'fulfillment_order';
3536

37+
/**
38+
* @inheritDoc
39+
*/
40+
protected $childResource = array (
41+
'FulfillmentRequest'
42+
);
3643

3744
/**
3845
* @inheritDoc

lib/FulfillmentRequest.php

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at 8/19/16 5:28 PM UTC+06:00
6+
*
7+
* @see https://help.shopify.com/api/reference/fulfillmentservice Shopify API Reference for FulfillmentService
8+
*/
9+
10+
namespace PHPShopify;
11+
12+
/**
13+
* --------------------------------------------------------------------------
14+
* FulfillmentRequest -> Child Resources
15+
* --------------------------------------------------------------------------
16+
*
17+
* --------------------------------------------------------------------------
18+
* FulfillmentRequest -> Custom actions
19+
* --------------------------------------------------------------------------
20+
* @method array accept() Accept a fulfilment order
21+
* @method array reject() Rejects a fulfillment order
22+
*/
23+
class FulfillmentRequest extends ShopifyResource
24+
{
25+
/**
26+
* @inheritDoc
27+
*/
28+
protected $resourceKey = 'fulfillment_request';
29+
30+
/**
31+
* @inheritDoc
32+
*/
33+
public $countEnabled = false;
34+
35+
/**
36+
* @inheritDoc
37+
*/
38+
protected $customPostActions = array(
39+
'accept',
40+
'reject'
41+
);
42+
43+
protected function pluralizeKey()
44+
{
45+
return $this->resourceKey;
46+
}
47+
}

lib/Order.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* --------------------------------------------------------------------------
1616
* Order -> Child Resources
1717
* --------------------------------------------------------------------------
18+
* @property-read FulfillmentOrder $FulfillmentOrder
1819
* @property-read Fulfillment $Fulfillment
1920
* @property-read OrderRisk $Risk
2021
* @property-read Refund $Refund

0 commit comments

Comments
 (0)