Skip to content

Commit ac76189

Browse files
authored
Merge pull request #220 from akeneo/fix-client-doc
Some error in the 3.0 content
2 parents 766e800 + 74bbe04 commit ac76189

File tree

7 files changed

+121
-128
lines changed

7 files changed

+121
-128
lines changed

content/php-client/ee-resources/product-model-drafts.md

Lines changed: 0 additions & 59 deletions
This file was deleted.

content/php-client/introduction.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ Two clients exist:
66
- a **Community Edition** client, covering the API endpoints of the PIM Community Edition
77
- an **Enterprise Edition** client, covering the API endpoints of both the PIM Community Edition and the PIM Enterprise Edition
88

9-
There are two versions of these clients:
9+
There are three versions of these clients:
1010
- The version v1.0 is compatible with the PIM 2.0.
11-
- The current and latest version v2.0 is compatible with the PIM 2.1
11+
- The version v2.0 is compatible with the PIM 2.1 and 2.2.
12+
- The current and latest version v3.0 is compatible with the PIM 2.3.
1213

1314
## Support & issues
1415
Please be aware that these PHP clients are only supported **in best effort**, whether you are an Entreprise or Community customer.

content/php-client/resources/product-entities/product-drafts.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,34 @@ $client = new \Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientBuilder('
1212
/*
1313
* Returns an array like this:
1414
* [
15-
* 'identifier': 'top',
16-
* 'enabled': true,
17-
* 'family': 'tshirt',
18-
* 'categories': ['summer_collection'],
19-
* 'groups': [],
20-
* 'values': [
21-
* 'name': [
15+
* 'identifier' => 'top',
16+
* 'enabled' => true,
17+
* 'family' => 'tshirt',
18+
* 'categories' => ['summer_collection'],
19+
* 'groups' => [],
20+
* 'values' => [
21+
* 'name' => [
2222
* [
23-
* 'data': 'Top',
24-
* 'locale': 'en_US',
25-
* 'scope': null
23+
* 'data' => 'Top',
24+
* 'locale' => 'en_US',
25+
* 'scope' => null
2626
* ],
2727
* [
28-
* 'data': 'Débardeur',
29-
* 'locale': 'fr_FR',
30-
* 'scope': null
28+
* 'data' => 'Débardeur',
29+
* 'locale' => 'fr_FR',
30+
* 'scope' => null
3131
* ],
3232
* ],
3333
* ],
34-
* 'created': '2016-06-23T18:24:44+02:00',
35-
* 'updated': '2016-06-25T17:56:12+02:00',
36-
* 'associations': [
37-
* 'PACK': [
38-
* 'products': [
34+
* 'created' => '2016-06-23T18:24:44+02:00',
35+
* 'updated' => '2016-06-25T17:56:12+02:00',
36+
* 'associations' => [
37+
* 'PACK' => [
38+
* 'products' => [
3939
* 'sunglass'
4040
* ],
41-
* 'groups': [],
42-
* 'product_models': []
41+
* 'groups' => [],
42+
* 'product_models' => []
4343
* ],
4444
* ],
4545
* 'metadata' => [
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
### Product model draft
2+
3+
::: warning
4+
This resource is only available in the [Entreprise Edition](https://www.akeneo.com/enterprise-edition/) and in the 3.0 version of the PHP API client.
5+
:::
6+
7+
#### Get a product model draft
8+
9+
```php
10+
$client = new \Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientBuilder('http://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
11+
12+
/*
13+
* Returns an array like this:
14+
* [
15+
* 'code' => 'rain_boots_red',
16+
* 'family_variant' => 'boots_color_size',
17+
* 'parent' => 'rain_boots',
18+
* 'categories' => ['2014_collection', 'winter_collection', 'winter_boots'],
19+
* 'values' => [
20+
* 'name' => [
21+
* [
22+
* 'locale' => 'en_US',
23+
* 'scope' => null,
24+
* 'data' => 'Red rain boots',
25+
* ]
26+
* ],
27+
* ],
28+
* 'created' => '2017-10-17T14:12:35+00:00',
29+
* 'updated' => '2017-10-17T14:12:35+00:00',
30+
* 'metadata' => [
31+
* 'workflow_status' => 'draft_in_progress',
32+
* ],
33+
* ]
34+
*/
35+
$draftProduct = $client->getProductModelDraftApi()->get('rain_boots_red');
36+
```
37+
38+
You can get more information about the returned format of the product values [here](/documentation/resources.html#product-values).
39+
40+
The field `metadata` is specific to Akeneo PIM Enterprise Edition. The status of the draft is specified in this field.
41+
42+
43+
#### Submit a product model draft for approval
44+
45+
```php
46+
$client = new \Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientBuilder('http://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
47+
48+
$client->getProductModelDraftApi()->submitForApproval('rain_boots_red');
49+
```
50+
51+
It is mandatory that the user already created a draft for the product model `rain_boots_red`, and that this draft was not approved yet.

content/php-client/resources/product-entities/product-models.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ $productModel = $client->getProductModelApi()->get('rain_boots_red');
3030

3131
You can get more information about the returned format of the product values [here](/documentation/resources.html#product-values).
3232

33-
Since the 2.3 version, in the Enterprise Edition, the response contains one more field `metadata`. Look at the [product model drafts](/php-client/ee-resources.html#product-model-draft) for an example.
33+
Since the 2.3 version, in the Enterprise Edition, the response contains one more field `metadata`. Look at the [product model drafts](/php-client/resources.html#product-model-draft) for an example.
3434

3535
#### Get a list of product models
3636

3737
There are two ways of getting product models.
3838

39-
*Search builder**
39+
**Search builder**
4040

4141
::: warning
42-
This feature is only available since the version 2.0 of the PHP API client.
42+
This feature is only available since the version 3.0 of the PHP API client.
4343
Also it was added in the 2.3 version of the PIM and is therefore not present in previous versions.
4444
:::
4545

@@ -62,7 +62,7 @@ $searchFilters = $searchBuilder->getFilters();
6262

6363
This method allows you to get product models page per page, as a classical pagination.
6464
It's possible to get the total number of product models with this method.
65-
As for the paginated method, since the 2.3 version of the Akeneo PIM, the search builder can be used and all query parameters are available, except `with_count`.
65+
As for the paginated method, since the 3.0 version of the PHP client, the search builder can be used and all query parameters are available, except `with_count`.
6666

6767
For example, we only return product values belonging to the channel "ecommerce" by adding the query parameter `'scope' => 'ecommerce'`.
6868
```php
@@ -93,7 +93,7 @@ You can get more information about this method [here](/php-client/list-resources
9393
This method allows you to iterate the product models. It will automatically get the next pages for you.
9494
With this method, it's not possible to get the previous page, or get the total number of product models.
9595

96-
As for the paginated method, since the 2.3 version of the Akeneo PIM, the search builder can be used and all query parameters are available, except `with_count`.
96+
As for the paginated method, since the 3.0 version of the PHP client, the search builder can be used and all query parameters are available, except `with_count`.
9797

9898
For example, in this example, we only return product values belonging to the channel "ecommerce" by adding the query parameter `'scope' => 'ecommerce'`.
9999

content/php-client/resources/product-entities/products.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,35 @@ $client = new \Akeneo\Pim\ApiClient\AkeneoPimClientBuilder('http://akeneo.com/')
88
/*
99
* Returns an array like this:
1010
* [
11-
* 'identifier': 'top',
12-
* 'enabled': true,
13-
* 'family': 'tshirt',
14-
* 'categories': ['summer_collection'],
15-
* 'groups': [],
16-
* 'parent': null,
17-
* 'values': [
18-
* 'name': [
11+
* 'identifier' => 'top',
12+
* 'enabled' => true,
13+
* 'family' => 'tshirt',
14+
* 'categories' => ['summer_collection'],
15+
* 'groups' => [],
16+
* 'parent' => null,
17+
* 'values' => [
18+
* 'name' => [
1919
* [
20-
* 'data': 'Top',
21-
* 'locale': 'en_US',
22-
* 'scope': null
20+
* 'data' => 'Top',
21+
* 'locale' => 'en_US',
22+
* 'scope' => null
2323
* ],
2424
* [
25-
* 'data': 'Débardeur',
26-
* 'locale': 'fr_FR',
27-
* 'scope': null
25+
* 'data' => 'Débardeur',
26+
* 'locale' => 'fr_FR',
27+
* 'scope' => null
2828
* ],
2929
* ],
3030
* ],
31-
* 'created': '2016-06-23T18:24:44+02:00',
32-
* 'updated': '2016-06-25T17:56:12+02:00',
33-
* 'associations': [
34-
* 'PACK': [
35-
* 'products': [
31+
* 'created' => '2016-06-23T18:24:44+02:00',
32+
* 'updated' => '2016-06-25T17:56:12+02:00',
33+
* 'associations' => [
34+
* 'PACK' => [
35+
* 'products' => [
3636
* 'sunglass'
3737
* ],
38-
* 'groups': [],
39-
* 'product_models': []
38+
* 'groups' => [],
39+
* 'product_models' => []
4040
* ],
4141
* ],
4242
* ]
@@ -46,7 +46,7 @@ $product = $client->getProductApi()->get('top');
4646

4747
You can get more information about the returned format of the product values [here](/documentation/resources.html#product-values).
4848

49-
In the Enterprise Edition, the response contains one more field `metadata`. Look at the [product drafts](/php-client/ee-resources.html#product-draft) for an example.
49+
In the Enterprise Edition, the response contains one more field `metadata`. Look at the [product drafts](/php-client/resources.html#product-draft) for an example.
5050

5151
::: warning
5252
The field `product_models` in the `associations` property was added in the 2.1 version of the PIM and is therefore not present in previous versions.

content/php-client/resources/product-entities/published-products.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,34 @@ $client = new \Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientBuilder('
1212
/*
1313
* Returns an array like this:
1414
* [
15-
* 'identifier': 'top',
16-
* 'enabled': true,
17-
* 'family': 'tshirt',
18-
* 'categories': ['summer_collection'],
19-
* 'groups': [],
20-
* 'values': [
21-
* 'name': [
15+
* 'identifier' => 'top',
16+
* 'enabled' => true,
17+
* 'family' => 'tshirt',
18+
* 'categories' => ['summer_collection'],
19+
* 'groups' => [],
20+
* 'values' => [
21+
* 'name' => [
2222
* [
23-
* 'data': 'Top',
24-
* 'locale': 'en_US',
25-
* 'scope': null
23+
* 'data' => 'Top',
24+
* 'locale' => 'en_US',
25+
* 'scope' => null
2626
* ],
2727
* [
28-
* 'data': 'Débardeur',
29-
* 'locale': 'fr_FR',
30-
* 'scope': null
28+
* 'data' => 'Débardeur',
29+
* 'locale' => 'fr_FR',
30+
* 'scope' => null
3131
* ],
3232
* ],
3333
* ],
34-
* 'created': '2016-06-23T18:24:44+02:00',
35-
* 'updated': '2016-06-25T17:56:12+02:00',
36-
* 'associations': [
37-
* 'PACK': [
38-
* 'products': [
34+
* 'created' => '2016-06-23T18:24:44+02:00',
35+
* 'updated' => '2016-06-25T17:56:12+02:00',
36+
* 'associations' => [
37+
* 'PACK' => [
38+
* 'products' => [
3939
* 'sunglass'
4040
* ],
41-
* 'groups': [],
42-
* 'product_models': []
41+
* 'groups' => [],
42+
* 'product_models' => []
4343
* ],
4444
* ],
4545
* ]

0 commit comments

Comments
 (0)