|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Helix\Shopify; |
|
4
|
|
|
|
|
5
|
|
|
use Helix\Shopify\Base\AbstractEntity; |
|
6
|
|
|
use Helix\Shopify\Base\AbstractEntity\CreateTrait; |
|
7
|
|
|
use Helix\Shopify\Base\AbstractEntity\UpdateTrait; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* A Shopify+ gift card. |
|
11
|
|
|
* |
|
12
|
|
|
* Gift cards cannot be deleted. |
|
13
|
|
|
* |
|
14
|
|
|
* @see https://shopify.dev/docs/admin-api/rest/reference/plus/giftcard |
|
15
|
|
|
* |
|
16
|
|
|
* @method $this setCode (string $code) @depends create-only, write-only |
|
17
|
|
|
* @method $this setInitialValue (number $value) @depends create-only |
|
18
|
|
|
* |
|
19
|
|
|
* @method string getApiClientId () |
|
20
|
|
|
* @method number getBalance () |
|
21
|
|
|
* @method string getCreatedAt () |
|
22
|
|
|
* @method string getCurrency () |
|
23
|
|
|
* @method string getCustomerId () |
|
24
|
|
|
* @method string getDisabledAt () |
|
25
|
|
|
* @method null|string getExpiresOn () |
|
26
|
|
|
* @method number getInitialValue () |
|
27
|
|
|
* @method string getLastCharacters () read-only |
|
28
|
|
|
* @method string getLineItemId () |
|
29
|
|
|
* @method string getNote () |
|
30
|
|
|
* @method string getOrderId () |
|
31
|
|
|
* @method null|string getTemplateSuffix () |
|
32
|
|
|
* @method string getUpdatedAt () |
|
33
|
|
|
* @method string getUserId () |
|
34
|
|
|
* |
|
35
|
|
|
* @method $this setApiClientId (string $id) |
|
36
|
|
|
* @method $this setBalance (number $balance) |
|
37
|
|
|
* @method $this setCreatedAt (string $iso8601) |
|
38
|
|
|
* @method $this setCurrency (string $currency) |
|
39
|
|
|
* @method $this setCustomerId (string $id) |
|
40
|
|
|
* @method $this setDisabledAt (string $iso8601) |
|
41
|
|
|
* @method $this setExpiresOn (?string $date) |
|
42
|
|
|
* @method $this setLineItemId (string $id) |
|
43
|
|
|
* @method $this setNote (string $note) |
|
44
|
|
|
* @method $this setOrderId (string $id) |
|
45
|
|
|
* @method $this setTemplateSuffix (?string $suffix) |
|
46
|
|
|
* @method $this setUpdatedAt (string $iso8601) |
|
47
|
|
|
* @method $this setUserId (string $id) |
|
48
|
|
|
*/ |
|
49
|
|
|
class GiftCard extends AbstractEntity { |
|
50
|
|
|
|
|
51
|
|
|
use CreateTrait; |
|
52
|
|
|
use UpdateTrait; |
|
53
|
|
|
|
|
54
|
|
|
const TYPE = 'gift_card'; |
|
55
|
|
|
const DIR = 'gift_cards'; |
|
56
|
|
|
|
|
57
|
|
|
const SEARCH_STATUS_DISABLED = 'disabled'; |
|
58
|
|
|
const SEARCH_STATUS_ENABLED = 'enabled'; |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* @return Customer |
|
62
|
|
|
*/ |
|
63
|
|
|
public function getCustomer () { |
|
64
|
|
|
return Customer::load($this, $this->getCustomerId()); |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
/** |
|
68
|
|
|
* @return Order |
|
69
|
|
|
*/ |
|
70
|
|
|
public function getOrder () { |
|
71
|
|
|
return Order::load($this, $this->getOrderId()); |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* @return User |
|
76
|
|
|
*/ |
|
77
|
|
|
public function getUser () { |
|
78
|
|
|
return User::load($this, $this->getUserId()); |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
} |