Skip to content

Commit 2c91c57

Browse files
committed
fix(API-1860): Fix some ProductUuid stuff
1 parent d8831bf commit 2c91c57

File tree

2 files changed

+41
-8
lines changed

2 files changed

+41
-8
lines changed

content/php-client/resources/products/product-drafts-uuid.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ $client = new \Akeneo\Pim\ApiClient\AkeneoPimClientBuilder('http://akeneo.com/')
1919
* 'categories' => ['summer_collection'],
2020
* 'groups' => [],
2121
* 'values' => [
22+
* 'sku' => [
23+
* [
24+
* 'locale' => null,
25+
* 'scope' => null,
26+
* 'data' => 'top'
27+
* ]
28+
* ],
2229
* 'name' => [
2330
* [
2431
* 'data' => 'Top',

content/php-client/resources/products/products-uuid.md

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### Product UUID
22

33
::: info
4-
The following endpoints are largely the same as for [products](/php-client/resources.html#products-uuid). The difference? Here, you can query, create or update products identified by its uuid. More information [here](/content/getting-started/from-identifiers-to-uuid-7x/welcome.md).
4+
The following endpoints are largely the same as for [products](/php-client/resources.html#products). The difference? Here, you can query, create or update products identified by their uuid. More information [here](/content/getting-started/from-identifiers-to-uuid-7x/welcome.md).
55
:::
66

77
#### Get a product
@@ -13,13 +13,20 @@ $client = new \Akeneo\Pim\ApiClient\AkeneoPimClientBuilder('http://akeneo.com/')
1313
/*
1414
* Returns an array like this:
1515
* [
16-
* 'identifier' => 'top',
16+
* 'uuid' => '12951d98-210e-4bRC-ab18-7fdgf1bd14f3',
1717
* 'enabled' => true,
1818
* 'family' => 'tshirt',
1919
* 'categories' => ['summer_collection'],
2020
* 'groups' => [],
2121
* 'parent' => null,
2222
* 'values' => [
23+
* 'sku' => [
24+
* [
25+
* 'locale' => null,
26+
* 'scope' => null,
27+
* 'data' => 'top'
28+
* ]
29+
* ],
2330
* 'name' => [
2431
* [
2532
* 'data' => 'Top',
@@ -108,7 +115,7 @@ There is a maximum limit allowed on server side for the parameter `limit`.
108115
:::
109116

110117
::: warning
111-
Setting the parameter `with_count` to `true` can drastically decrease the performance.
118+
Setting the parameter `with_count` to `true` can drastically decrease the performance.
112119
It's recommended to let this parameter with the default value `false` if the total number of products is not needed in the response.
113120
:::
114121

@@ -154,13 +161,20 @@ If the product does not exist yet, this method creates it, otherwise it throws a
154161
$client = new \Akeneo\Pim\ApiClient\AkeneoPimClientBuilder('http://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
155162

156163
$client->getProductUuidApi()->create('844c736b-a19b-48a6-a354-6056044729f0', [
157-
'identifier' => 'top',
164+
'uuid' => '844c736b-a19b-48a6-a354-6056044729f0',
158165
'enabled' => true,
159166
'family' => 'tshirt',
160167
'categories' => ['summer_collection'],
161168
'groups' => [],
162169
'parent'=> null,
163170
'values' => [
171+
'sku' => [
172+
[
173+
'locale' => null,
174+
'scope' => null,
175+
'data' => 'top'
176+
]
177+
],
164178
'name' => [
165179
[
166180
'data' => 'top',
@@ -204,13 +218,20 @@ If the product does not exist yet, this method creates it, otherwise it updates
204218
$client = new \Akeneo\Pim\ApiClient\AkeneoPimClientBuilder('http://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
205219

206220
$client->getProductUuidApi()->upsert('844c736b-a19b-48a6-a354-6056044729f0', [
207-
'identifier' => 'top',
221+
'uuid' => '844c736b-a19b-48a6-a354-6056044729f0',
208222
'enabled' => true,
209223
'family' => 'tshirt',
210224
'categories' => ['summer_collection'],
211225
'groups' => [],
212226
'parent'=> null,
213227
'values' => [
228+
'sku' => [
229+
[
230+
'locale' => null,
231+
'scope' => null,
232+
'data' => 'top'
233+
]
234+
],
214235
'name' => [
215236
[
216237
'data' => 'top',
@@ -258,11 +279,17 @@ $client = new \Akeneo\Pim\ApiClient\AkeneoPimClientBuilder('http://akeneo.com/')
258279
$responseLines = $client->getProductUuidApi()->upsertList([
259280
[
260281
'uuid' => '12951d98-210e-4bRC-ab18-7fdgf1bd14f3',
261-
'identifier' => 'top',
262282
'family' => 'tshirt',
263283
'categories' => ['summer_collection'],
264284
'groups' => [],
265285
'values' => [
286+
'sku' => [
287+
[
288+
'locale' => null,
289+
'scope' => null,
290+
'data' => 'top'
291+
]
292+
],
266293
'price' => [
267294
[
268295
'data' => [
@@ -283,14 +310,13 @@ $responseLines = $client->getProductUuidApi()->upsertList([
283310
],
284311
[
285312
'uuid' => '12951d98-210e-4bRC-ab18-7fdgf1bd14f4',
286-
'identifier' => 'cap',
287313
'categories' => ['hat'],
288314
],
289315
]);
290316

291317
foreach ($responseLines as $line) {
292318
echo $line['line'];
293-
echo $line['identifier'];
319+
echo $line['uuid'];
294320
echo $line['status_code'];
295321
if (isset($line['message'])) {
296322
echo $line['message'];

0 commit comments

Comments
 (0)