| Total Complexity | 4 |
| Total Lines | 66 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | trait ProductsFamilies |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Create a product family. |
||
| 9 | * |
||
| 10 | * @param array $data |
||
| 11 | * |
||
| 12 | * @return array |
||
| 13 | */ |
||
| 14 | public function product_family_create(array $data): array |
||
| 15 | { |
||
| 16 | $this->apiEndPoint = '/product_families.json'; |
||
| 17 | |||
| 18 | $this->verb = 'post'; |
||
| 19 | |||
| 20 | $this->options['json'] = [ |
||
|
|
|||
| 21 | 'product_family' => $data, |
||
| 22 | ]; |
||
| 23 | |||
| 24 | return $this->doChargifyRequest(); |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Get details for a product family. |
||
| 29 | * |
||
| 30 | * @param int $family_id |
||
| 31 | * |
||
| 32 | * @return array |
||
| 33 | */ |
||
| 34 | public function product_family_details(int $family_id): array |
||
| 35 | { |
||
| 36 | $this->apiEndPoint = "/product_families/{$family_id}.json"; |
||
| 37 | |||
| 38 | $this->verb = 'get'; |
||
| 39 | |||
| 40 | return $this->doChargifyRequest(); |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Create a product family. |
||
| 45 | * |
||
| 46 | * @return array |
||
| 47 | */ |
||
| 48 | public function product_families_list(): array |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Get products list for a product family. |
||
| 59 | * |
||
| 60 | * @param int $family_id |
||
| 61 | * |
||
| 62 | * @return array |
||
| 63 | */ |
||
| 64 | public function product_family_products(int $family_id): array |
||
| 71 | } |
||
| 72 | } |
||
| 73 |