Skip to content

Commit 7e5bed4

Browse files
committed
Implement the missing _create_ and _update_ endpoints for Brands
1 parent 563dd3e commit 7e5bed4

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
11
### New Features
22

3-
- Implement the [Cart API](https://developer.bigcommerce.com/api-reference/store-management/carts/cart/createacart).
4-
- Implement the [Cart Items API](https://developer.bigcommerce.com/api-reference/store-management/carts/cart-items/addcartlineitem)
5-
- Implement the [Cart Redirect URLS API](https://developer.bigcommerce.com/api-reference/store-management/carts/cart-redirect-urls/createcartredirecturl)
6-
- Allow the use of [parameters in ProductsApi::Get](https://developer.bigcommerce.com/api-reference/store-management/catalog/products/getproductbyid).
7-
8-
Here's an example using PHP 8:
9-
10-
```php
11-
$product = $api->catalog()->product(123)->get(include_fields: ['description', 'sku'])->getProduct();
12-
```
13-
14-
### Bug Fix
15-
16-
Fix issue with ProductVariant::sku_id not being nullable #47 (thanks @Yorgv)
3+
- Implement the missing _create_ and _update_ endpoints for Brands.
174

185

src/BigCommerce/Api/Catalog/BrandsApi.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use BigCommerce\ApiV3\Api\Generic\ResourceApi;
66
use BigCommerce\ApiV3\Api\Catalog\Brands\BrandImageApi;
77
use BigCommerce\ApiV3\Api\Catalog\Brands\BrandMetafieldsApi;
8+
use BigCommerce\ApiV3\ResourceModels\Catalog\Brand\Brand;
89
use BigCommerce\ApiV3\ResponseModels\Brand\BrandResponse;
910
use BigCommerce\ApiV3\ResponseModels\Brand\BrandsResponse;
1011

@@ -39,6 +40,16 @@ public function getAll(array $filters = [], int $page = 1, int $limit = 250): Br
3940
return new BrandsResponse($this->getAllResources($filters, $page, $limit));
4041
}
4142

43+
public function create(Brand $brand): BrandResponse
44+
{
45+
return new BrandResponse($this->createResource($brand));
46+
}
47+
48+
public function update(Brand $brand): BrandResponse
49+
{
50+
return new BrandResponse($this->updateResource($brand));
51+
}
52+
4253
public function getAllPages(array $filter = []): BrandsResponse
4354
{
4455
return BrandsResponse::buildFromAllPages(function ($page) use ($filter) {

0 commit comments

Comments
 (0)