| @@ 7-35 (lines=29) @@ | ||
| 4 | ||
| 5 | use Codexshaper\WooCommerce\PHP\WooCommerce; |
|
| 6 | ||
| 7 | class ShippingMethod extends BaseModel |
|
| 8 | { |
|
| 9 | protected $endpoint = 'shipping_methods'; |
|
| 10 | ||
| 11 | /** |
|
| 12 | * Retrieve all Items. |
|
| 13 | * |
|
| 14 | * @param array $options |
|
| 15 | * |
|
| 16 | * @return array |
|
| 17 | */ |
|
| 18 | protected function all($options = []) |
|
| 19 | { |
|
| 20 | return WooCommerce::all($this->endpoint, $options); |
|
| 21 | } |
|
| 22 | ||
| 23 | /** |
|
| 24 | * Retrieve single Item. |
|
| 25 | * |
|
| 26 | * @param int $id |
|
| 27 | * @param array $options |
|
| 28 | * |
|
| 29 | * @return object |
|
| 30 | */ |
|
| 31 | protected function find($id, $options = []) |
|
| 32 | { |
|
| 33 | return WooCommerce::find("{$this->endpoint}/{$id}", $options); |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||
| @@ 7-35 (lines=29) @@ | ||
| 4 | ||
| 5 | use Codexshaper\WooCommerce\PHP\WooCommerce; |
|
| 6 | ||
| 7 | class ShippingZoneMethod extends BaseModel |
|
| 8 | { |
|
| 9 | protected $endpoint = 'shipping_methods'; |
|
| 10 | ||
| 11 | /** |
|
| 12 | * Retrieve all Items. |
|
| 13 | * |
|
| 14 | * @param array $options |
|
| 15 | * |
|
| 16 | * @return array |
|
| 17 | */ |
|
| 18 | protected function all($options = []) |
|
| 19 | { |
|
| 20 | return WooCommerce::all($this->endpoint, $options); |
|
| 21 | } |
|
| 22 | ||
| 23 | /** |
|
| 24 | * Retrieve single Item. |
|
| 25 | * |
|
| 26 | * @param int $id |
|
| 27 | * @param array $options |
|
| 28 | * |
|
| 29 | * @return object |
|
| 30 | */ |
|
| 31 | protected function find($id, $options = []) |
|
| 32 | { |
|
| 33 | return WooCommerce::find("{$this->endpoint}/{$id}", $options); |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||