diff --git a/src/Builders/CustomerGroupBuilder.php b/src/Builders/CustomerGroupBuilder.php new file mode 100644 index 0000000..d9c71e6 --- /dev/null +++ b/src/Builders/CustomerGroupBuilder.php @@ -0,0 +1,32 @@ +parseFilters( $filters ); + + return $this->request->handleWithExceptions( function () use ( $urlFilters ) { + + $response = $this->request->client->get( "{$this->entity}/search{$urlFilters}" ); + $responseData = json_decode( (string) $response->getBody() ); + $items = $this->parseResponse( $responseData ); + + return $items; + } ); + } +} \ No newline at end of file diff --git a/src/Magento.php b/src/Magento.php index 622e2db..23ab234 100644 --- a/src/Magento.php +++ b/src/Magento.php @@ -9,6 +9,7 @@ namespace KgBot\Magento; use KgBot\Magento\Builders\CustomerBuilder; +use KgBot\Magento\Builders\CustomerGroupBuilder; use KgBot\Magento\Builders\OrderBuilder; use KgBot\Magento\Builders\ProductBuilder; use KgBot\Magento\Utils\Request; @@ -65,4 +66,13 @@ public function products() { return new ProductBuilder( $this->request ); } + + /** + * @return \KgBot\Magento\Builders\CustomerGroupBuilder + */ + public function customer_groups() + { + + return new CustomerGroupBuilder( $this->request ); + } } \ No newline at end of file diff --git a/src/Models/CustomerGroup.php b/src/Models/CustomerGroup.php new file mode 100644 index 0000000..696e0db --- /dev/null +++ b/src/Models/CustomerGroup.php @@ -0,0 +1,18 @@ +