Skip to content

Commit d47fbb7

Browse files
authored
[On Hold] - API-1859: PHP client Catalog update
1 parent 2e02616 commit d47fbb7

File tree

3 files changed

+104
-2
lines changed

3 files changed

+104
-2
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
### App catalog product
2+
3+
4+
#### Get the list of product uuids
5+
::: php-client-availability versions=9.1 editions=CE,EE
6+
7+
```php
8+
$client = new \Akeneo\Pim\ApiClient\AkeneoPimClientBuilder('https://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
9+
10+
/*
11+
* Returns an array like the following:
12+
* [
13+
* "844c736b-a19b-48a6-a354-6056044729f0",
14+
* "b2a683ef-4a91-4ed3-b3fa-76dab065a8d5",
15+
* "eddfbd2a-abc7-488d-b9e3-41289c824f80"
16+
* ]
17+
*/
18+
$catalogs = $client->getAppCatalogProductApi()->all();
19+
```
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
### App catalog
2+
3+
4+
#### Get the list of owned catalogs
5+
::: php-client-availability versions=9.1 editions=CE,EE
6+
7+
```php
8+
$client = new \Akeneo\Pim\ApiClient\AkeneoPimClientBuilder('https://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
9+
10+
/*
11+
* Returns an array like the following:
12+
* [
13+
* {
14+
* "id": "12351d98-200e-4bbc-aa19-7fdda1bd14f2",
15+
* "name": "Store FR",
16+
* "enabled": true
17+
* },
18+
* {
19+
* "id": "12351d98-200e-4bbc-aa19-7fdda1bd14f3",
20+
* "name": "Store US",
21+
* "enabled": true
22+
* }
23+
* ]
24+
*/
25+
$catalogs = $client->getAppCatalogApi()->all();
26+
```
27+
28+
29+
#### Get a catalog
30+
::: php-client-availability versions=9.1 editions=CE,EE
31+
32+
```php
33+
$client = new \Akeneo\Pim\ApiClient\AkeneoPimClientBuilder('https://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
34+
35+
/*
36+
* Returns an object like the following :
37+
* {
38+
* "id": "12351d98-200e-4bbc-aa19-7fdda1bd14f2",
39+
* "name": "Store FR",
40+
* "enabled": true
41+
* }
42+
*/
43+
$catalogs = $client->getAppCatalogApi()->get('12351d98-200e-4bbc-aa19-7fdda1bd14f2');
44+
```
45+
46+
#### Create a new catalog
47+
::: php-client-availability versions=9.1 editions=CE,EE
48+
49+
If the catalog does not exist yet, this method creates it, otherwise it throws an exception.
50+
51+
```php
52+
$client = new \Akeneo\Pim\ApiClient\AkeneoPimClientBuilder('http://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
53+
54+
$client->getAppCatalogApi()->create(['name' => 'A catalog name']);
55+
```
56+
57+
58+
#### Update a catalog
59+
::: php-client-availability versions=9.1 editions=CE,EE
60+
61+
```php
62+
$client = new \Akeneo\Pim\ApiClient\AkeneoPimClientBuilder('http://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
63+
64+
$client->getAppCatalogApi()->upsert(['name' => 'A catalog name']);
65+
```
66+
67+
68+
#### Delete a catalog
69+
::: php-client-availability versions=9.1 editions=CE,EE
70+
71+
```php
72+
$client = new \Akeneo\Pim\ApiClient\AkeneoPimClientBuilder('http://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
73+
74+
$client->getAppCatalogApi()->delete('12351d98-200e-4bbc-aa19-7fdda1bd14f2');
75+
```

tasks/build-doc.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,13 @@ gulp.task('build-concepts', ['clean-dist','less'], function () {
647647
}
648648
);
649649

650+
gulp.task('create-app-catalog-md', function () {
651+
return gulp.src(['content/php-client/resources/app-catalog/app-catalog.md','content/php-client/resources/app-catalog/app-catalog.md','content/php-client/resources/app-catalog/*.md'])
652+
.pipe(concat('app-catalog.md'))
653+
.pipe(insert.prepend('## App catalog\n'))
654+
.pipe(gulp.dest('tmp/php-client-resources/'));
655+
});
656+
650657
gulp.task('create-products-md', function () {
651658
return gulp.src(['content/php-client/resources/products/products.md','content/php-client/resources/products/product-models.md','content/php-client/resources/products/*.md'])
652659
.pipe(concat('products.md'))
@@ -683,13 +690,14 @@ gulp.task('create-asset-manager-md', function () {
683690
.pipe(insert.prepend('## Asset Manager\n'))
684691
.pipe(gulp.dest('tmp/php-client-resources/'));
685692
});
686-
gulp.task('create-resources-md', ['create-products-md','create-catalog-structure-md', 'create-target-market-settings-md', 'create-PAM-md', 'create-reference-entity-md', 'create-asset-manager-md'], function () {
693+
gulp.task('create-resources-md', ['create-app-catalog-md','create-products-md','create-catalog-structure-md', 'create-target-market-settings-md', 'create-PAM-md', 'create-reference-entity-md', 'create-asset-manager-md'], function () {
687694
return gulp.src(['tmp/php-client-resources/products.md',
688695
'tmp/php-client-resources/catalog-structure.md',
689696
'tmp/php-client-resources/target-market-settings.md',
690697
'tmp/php-client-resources/asset-manager.md',
691698
'tmp/php-client-resources/PAM.md',
692-
'tmp/php-client-resources/reference-entity.md'])
699+
'tmp/php-client-resources/reference-entity.md',
700+
'tmp/php-client-resources/app-catalog.md'])
693701
.pipe(concat('resources.md'))
694702
.pipe(insert.prepend('# Resources\n'))
695703
.pipe(gulp.dest('tmp/php-client'));

0 commit comments

Comments
 (0)