Skip to content

Commit 33952a9

Browse files
Merge pull request #147 from damien-carcel/API-421
API-421: Add "Get product drafts" client resource
2 parents c3d32de + 90bfa8d commit 33952a9

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ $product = $client->getProductApi()->get('top');
4545

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

48+
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+
4850
### Get a list of products
4951

5052
There are two ways of getting products. Also, you have a search builder to ease the construction of a research.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
## Product draft
2+
3+
### Get a product draft
4+
5+
```php
6+
$client = new \Akeneo\PimEnterprise\AkeneoPimEnterpriseClientBuilder('http://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
7+
8+
/*
9+
* Returns an array like this:
10+
* [
11+
* 'identifier': 'top',
12+
* 'enabled': true,
13+
* 'family': 'tshirt',
14+
* 'categories': ['summer_collection'],
15+
* 'groups': [],
16+
* 'values': [
17+
* 'name': [
18+
* [
19+
* 'data': 'Top',
20+
* 'locale': 'en_US',
21+
* 'scope': null
22+
* ],
23+
* [
24+
* 'data': 'Débardeur',
25+
* 'locale': 'fr_FR',
26+
* 'scope': null
27+
* ],
28+
* ],
29+
* ],
30+
* 'created': '2016-06-23T18:24:44+02:00',
31+
* 'updated': '2016-06-25T17:56:12+02:00',
32+
* 'associations': [
33+
* 'PACK': [
34+
* 'products': [
35+
* 'sunglass'
36+
* ],
37+
* 'groups': []
38+
* ],
39+
* ],
40+
* 'metadata' => [
41+
* 'workflow_status' => 'draft_in_progress',
42+
* ],
43+
* ]
44+
*/
45+
$publishedProduct = $client->getProductDraftApi()->get('top');
46+
```
47+
48+
You can get more information about the returned format of the product values [here](/documentation/resources.html#product-values).
49+
50+
The field `metadata` is specific to Akeneo PIM Enterprise Edition. The status of the draft is specified in this field.

0 commit comments

Comments
 (0)