Releases: commercetools/commercetools-php-sdk
v1.0.0-RC8
Bug Fixes
- Cart: typo in custom line item model (c583fb9)
- JsonObject: add missing static keyword to named constructors (f83e4c6)
- JsonObject: fix error message for unknown method (22431f8)
- Payment: add missing type for payment transactions (c6d3765)
- Payment: correct type for PaymentInfo model (b942a06)
Features
- CustomFields: add customs fields and types for prices (cfbc0bb), closes #156
- ImportOrder: add custom fields to ImportOrder (008702f)
- Order: add order delete request (5944de7)
BREAKING CHANGES
-
added PriceDraft to price update actions
The new PriceDraft object has been added as type hint to ProductAddPriceAction and ProductChangePriceAction. The ProductVariantDraft expects now a PriceDraftCollection
v1.0.0-RC7
Bug Fixes
- Cart: add corrected cart discount fields (b0bf1b7)
- LocalizedString: fix array conversion of locales for LocalizedString (ea50790)
- PaymentInfo correct class path (a9501fc)
Features
- JsonObject: recurse toArray method to child objects (feb3729)
BREAKING CHANGES
-
discountedPrice at LineItems has been removed
The discountedPrice field has been deprecated at the API and therefor was removed from the SDK.
Before:
$lineItem->getDiscountedPrice(); $discountedCentAmount = $lineItem->getDiscountedPrice()->getValue()->getCentAmount();
After:
$lineItem->getDiscountedPricePerQuantity(); $discountedCentAmount = 0; foreach ($lineItem->getDiscountedPricePerQuantity() as $discountedPricePerQuantity) { $discountedCentAmount += $discountedPricePerQuantity()->getQuantity() * $discountedPricePerQuantity->getDiscountedPrice()->getValue()->getCentAmount(); }
(b0bf1b7)
v1.0.0-RC5
v1.0.0-RC4
Bug Fixes
- Cart: fix addCustomLineItem update action (b2d704f), closes #154
- CustomTypes: update to breaking changes of the API (5e23104)
- Product: fix type for remove price action (c0a5ccc), closes #153
Features
- Order: add state to order (3a6cc3d)
- Payment: add payment messages (b9308c1)
- Payment: add payment requests and models (c720eed)
- Product: add state to product (95437d8)
- ProductSearch: add fuzzy flag to product search request (0ed8dc8)
- Review: add state to review (8278313)
BREAKING CHANGES
- update actions for changing the order of custom fields have been changed
v1.0.0-RC3
Bug Fixes
- Comment: delete comment endpoint functionality (506644c)
- OAuthManager: don't expose api credentials through exception callstack (f0caaa1)
- ProductDraft: use ProductVariantDraftCollection for variants (f252a2d), closes #142
Features
- CustomFields: add custom field models and mapping by type field definitions (146ee40) closes #119
- Message: add specific message objects (353b5ab) closes #128
- Orders: add cart field to order (922d812), closes #132 #131
- ProductSearch: add reference expansion to product search request (c003de6), closes #144
- ProductVariant: add helper methods to get variant by id (f2ff1d4)
- Products: add getBySku method (ab9a0b9)
- Products: add support to set EnumType and LocalizedEnumType attributes by key (df88267)
- Products: add support to set EnumType and LocalizedEnumType attributes by key in all variants (e07cad6)
- QueryRequest: add page request interface (ecc5666)
- QueryRequest: add sort and query request interfaces (d19c127)
- QueryRequest: add with total request interface (c1059ee)
- RedisCacheAdapter: unify life time (7b73d30)
- Reviews: add review delete request (2c6493e), closes #134
- ShippingMethod: add getByName and getById to ShippingMethodCollection (2de7668)
- UpdateActions: add limit to update actions (3f728a5)
- CategoryCollection: add getByParent and getRoots to CategoryCollection (ece9d87)
- LocalizedString: add support for locales to LocalizedString (ea5e1c6)
- Image: return empty thumb image url if no url is set (a4be01b)
BREAKING CHANGES
-
comments endpoint has been removed from the API
All models and request objects have been removed from the SDK
v1.0.0-RC2
Bug Fixes
Breaking Changes
-
SphereException and SphereServiceException have been renamed to ApiException and ApiServiceException
Before
try { ... } catch(SphereException $e) { }
After:
try { ... } catch(ApiException $e) { }
(813a6cb7)
-
Namespace Sphere has been renamed to Commercetools
Namespace and Use statements and fully qualified class names have to be adjusted. E.g.
Before
use Sphere\Core\Client; $class = '\Sphere\Core\Client';
After:
use Commercetools\Core\Client; $class = '\Commercetools\Core\Client';
(4bc9575f)
v1.0.0-RC1
Bug Fixes
- CustomerCreateRequest: set correct return object class (d1c100c9, closes #109)
- Requests: fix the usage of relative path by requests (e32d0150)
- Order: set correct return type for order discountCodes (5bbf4f14)
Features
- AnnotationGenerator: add magic method getAt and current with correct type hint to collections (324886db)
- Attribute: add feature to set attribute type definitions to attributes (37546b33)
- AttributeCollection: add feature to set attribute type definitions to attribute collection (af3b558a)
- CartDiscount: add update actions (c0e27dd5)
- Channel:
- Client: add named constructor to Client and Config object (1a0c350f, closes #101)
- Comments: add update actions (54804bf1)
- CustomerGroups: add update actions (30789b76)
- DiscountCodes: add update actions (e3357965)
- Exceptions: wrap http client exceptions (a169611b)
- Inventory: add update actions (12ea56d5)
- JsonObject: add magic getter to access object data as property (7a22cfa7)
- ProductDiscounts: add update actions (24bd9afb)
- ProductTypes: add update actions (50616ef8)
- Project: add project fetch request (4e8d232c, closes #35)
- Requests:
- Review: add update actions (4f1d55c8)
- ShippingMethod:
- State: add update actions (3833ad1d)
- TaxCategory: add update actions (428ba25a)
- Zones: add update actions (a74c3517)
Breaking Changes
-
QueryRequests renamed to singular form
To streamline the naming schemes between the SDKs QueryRequests have been renamed to their singular form. E.g.:
Before:
$request = CategoriesQueryRequest::of();
After:
$request = CategoryQueryRequest::of();
(8de23283)
-
SingleResourceResponse renamed to ResourceResponse
To streamline the naming schemes between the SDKs SingleResourceResponse has been renamed to ResourceResponse
(4199c815)
-
ImportLineItem renamed to LineItemImportDraft
To streamline the naming schemes between the SDKs ImportProductVariant, ImportLineItem and ImportLineItemCollection
have been renamed to ProductVariantImportDraft, LineItemImportDraft and LineItemImportDraftCollection.(018c7493)
-
CartDiscountCodeReference renamed to DiscountCodeInfo
To streamline the naming schemes between the SDKs CartDiscountCodeReference has been renamed to DiscountCodeInfo
(db14db07)
-
DeleteById requests renamed to Delete requests
To streamline the naming schemes between the SDKs delete requests have been renamed. E.g.:
Before:
$request = ProductDeleteByIdRequest::ofIdAndVersion('<id>', <version>);
After:
$request = ProductDeleteRequest::ofIdAndVersion('<id>', <version>);
(896e95a9)
-
FetchBy requests renamed to ByGetRequest
To streamline the naming schemes between the SDKs FetchBy requests have been renamed to ByGet requests. E.g.:
Before:
$request = ProductFetchByIdRequest::ofId('<id>');
After:
$request = ProductByIdGetRequest::ofId('<id>');
(d601dcfc)
-
Document has been renamed to Resource
To streamline the naming schemes between the SDKs Document has been renamed to Resource. Type checks have to be adjusted
Before:
if ($object instanceof \Sphere\Core\Model\Common\Document)
After:
if ($object instanceof \Sphere\Core\Model\Common\Resource)
(5704fa3e)
-
ProductSearchEndpoint has been renamed
Before:
$endpoint = ProductSearchEndpoint::endpoint();
After:
$endpoint = ProductProjectionEndpoint::endpoint();
closes #103
(e1b6989f)
-
ProductsSearchRequest has been renamed
Before:
$request = ProductsSearchRequest::of();
After:
$request = ProductProjectionSearchRequest::of();
closes #103
(bd1bf7b1)
-
config object fromArray method is declared static
Before:
$config = new Config(); $config->fromArray($configArray);
After:
$config = Config::fromArray($configArray);
closes #101
(1a0c350f)
-
ext-intl is now mandatory
(2afea8ad)
-
getters return null if value is not set
To have a more reliable return values the implied instantiation of empty objects has been removed. This means before using a value is must be set explicit. Example for collections
Before:
$obj = ProductTypeDraft::ofNameAndDescription('test', 'test'); $obj->getAttributes()->add(AttributeDefinition::of()->setName('test'));
After:
$obj = ProductTypeDraft::ofNameAndDescription('test', 'test'); $obj->setAttributes(AttributeDefinitionCollection::of()->add(AttributeDefinition::of()->setName('test')));
Closes #113
(8b138e7b)
-
all http client exceptions are now wrapped inside the SphereException hierarchy
Before:
try { $response = $client->execute($request) } catch(\GuzzleHttp\Exception\RequestException $e) { ... }
After:
try { $response = $client->execute($request) } catch(\Sphere\Core\Error\SphereException $e) { ... }
(a169611b)
-
rename client method future to executeAsync
To streamline the request executing methods the future method has been renamed. To migrate the code follow the example:
Before:
$response = $client->future($request);
After:
$response = $client->executeAsync($request);
(51da11fa)
-
changes the static "of" constructor to named constructors
The static constructor "of" for models and requests needs magic methods in the class header to provide proper IDE support. By using the library as a dependency the magic methods were not correctly used by the IDE. Also the reflection used inside the OfTrait is not the best solution. So now all models and requests should have one or more named constructors which can be properly read by most IDE, don't require reflection for instantiation and can create instances without parameters which is helpful for testing purposes.
- constructor of Models and Requests doesn't have required values anymore
- static "of" constructor instantiates class with given context object. Use named constructors for instantiating mod...
v1.0.0-beta.2
Major refactoring of the http client handling. Sphere client uses now PSR http messages for internal request and response representation and ships with a guzzle5 and guzzle6 http client adapter which will be automatically used. It's also possible to register new http client adapters implementing Sphere\Core\Client\Adapter\AdapterInterface
- switch composer to caret operator
- add redis to travis configuration
- update customer create endpoint with API changes
- add productSlug to LineItem
- add homepage and support sections to composer.json
- add accessor for adapter factory to client
- [BREAKING] move guzzle to http client adapter to reduce dependencies
- sphere client can use guzzle5 and guzzle6
- [BREAKING] fix product variants mapping type
- add price validity ranges
- add php-intl as dependency to readme for development
- [BREAKING] update price update and remove action to priceId
- update links to documentation
- [DEPRECATED] ProductSetMetaAttributesAction
- add meta attribute update actions for categories
- add meta attribute update actions for products
- change userAgent signature
- add missing type mappings to requests
- [BREAKING] add required attributes to StateDraft add behat test for StateCreate
- add ReviewCreateRequest
- add CommentCreateRequest
- add ProductDiscountCreateRequest
- add ProductTypeCreateRequest
- add hipchat notification
- set values collection type only on deserialisation in AttributeType
- FilterRange adds quotes to string and formats DateTime
- add ShippingMethodCreateRequest
- add InventoryCreateRequest
- add InventoryEntry model
- add DiscountCodeCreateRequest
- add CustomerGroupCreateRequest
- add ChannelCreateRequest
- add CartDiscountCreateRequest
- remove context type hint from TaxCategoryDraft
- add zone create request
- add context to ZoneDraft constructor
- add tax category create request
- add importOrder unit tests
- add order import request and models
- add sdk user agent to client header
- expose headers and status code in response objects
- refactor getters for results and facets in paged responses
- fix bool filter more type safe filter to string conversion
- more type safe filter to string conversion
- fix multi facet and filter params
- fix type of TaxRate
v1.0.0-beta.1
- add unit tests for query, fetch and delete requests
- add tests for order and product update actions
- add customer, category and cart update action tests
- refactor annotation generator
- refactor context aware objects to give a context callback to child
- add constructor tests for update commands
- add customer object and order create request test
- add customer request tests
- update Collection and JsonObject tests
- add model unit tests
- execute apigen only at master or tag changes
- fix state and taxRate
- add reference test
- add typed objects for references
- add currency formatter test
- refactor collection and jsonObject
- remove deprecated functions
- add integration tests for category
- refactor query parameters
- add reference getter to JsonObject
- return references only for documents
- log deprecation headers
- add pool size configuration to client
- add future requests
- add future tests
- add toString to LocalizedSearchKeywords model
- fix product draft tax category
- add links to api documentation for models
- correct type hints for zone requests
- add links to api documentation for requests
- add limit of update action logging to update requests
- add cache adapter for redis storage