1 | <?php |
||
18 | class Customer extends AbstractResource implements Resource |
||
19 | { |
||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $actions = [ |
||
24 | 'create' => [ |
||
25 | 'method' => 'POST', |
||
26 | 'endpoint' => 'customers.json', |
||
27 | 'resourceKey' => 'customer', |
||
28 | 'responseKey' => 'customer', |
||
29 | ], |
||
30 | 'get' => [ |
||
31 | 'method' => 'GET', |
||
32 | 'endpoint' => 'customers/%s.json', |
||
33 | 'resourceKey' => 'customer', |
||
34 | 'responseKey' => 'customer', |
||
35 | ], |
||
36 | 'search' => [ |
||
37 | 'method' => 'GET', |
||
38 | 'endpoint' => 'customers/search.json', |
||
39 | 'responseKey' => 'customers', |
||
40 | ], |
||
41 | 'all' => [ |
||
42 | 'method' => 'GET', |
||
43 | 'endpoint' => 'customers.json', |
||
44 | 'resourceKey' => 'customers', |
||
45 | 'responseKey' => 'customers', |
||
46 | ], |
||
47 | 'count' => [ |
||
48 | 'method' => 'GET', |
||
49 | 'endpoint' => 'customers/count.json', |
||
50 | 'resourceKey' => 'count', |
||
51 | 'responseKey' => 'count', |
||
52 | ], |
||
53 | 'update' => [ |
||
54 | 'method' => 'PUT', |
||
55 | 'endpoint' => 'customers/%s.json', |
||
56 | 'resourceKey' => 'customer', |
||
57 | 'responseKey' => 'customer', |
||
58 | ], |
||
59 | 'orders' => [ |
||
60 | 'method' => 'GET', |
||
61 | 'endpoint' => 'customers/%s/orders.json', |
||
62 | 'responseKey' => 'orders', |
||
63 | ], |
||
64 | 'delete' => [ |
||
65 | 'method' => 'DELETE', |
||
66 | 'endpoint' => 'customers/%s.json', |
||
67 | ], |
||
68 | ]; |
||
69 | |||
70 | protected $childResources = [ |
||
71 | 'metafields' => CustomerMetaField::class, |
||
72 | 'addresses' => CustomerAddress::class, |
||
73 | ]; |
||
74 | } |
||
75 |