Skip to content

Commit fc69689

Browse files
author
Willy Mesnage
authored
Merge pull request #134 from akeneo/API-409-bis
API-409: List entities PHP client
2 parents 6a00e09 + 9e93a14 commit fc69689

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed

content/php-client/resources/family-variants.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,45 @@ $client->getFamilyVariantApi()->create('boots', 'boots_size_color', [
5656
]
5757
]);
5858
```
59+
60+
### Get a list of family variants
61+
62+
There are two ways of getting family variants.
63+
64+
#### By getting pages
65+
66+
This method allows to get family variants page per page, as a classical pagination.
67+
It's possible to get the total number of family variants with this method.
68+
69+
```php
70+
$client = new \Akeneo\Pim\AkeneoPimClientBuilder('http://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
71+
72+
$firstPage = $client->getFamilyVariantApi()->listPerPage('boots', 50, true);
73+
```
74+
75+
::: warning
76+
There is a maximum limit allowed on server side for the parameter `limit`.
77+
:::
78+
79+
::: warning
80+
Setting the parameter `with_count` to `true` can drastically decrease the performance.
81+
It's recommended to let this parameter with the default value `false` if the total number of family variants is not needed in the response.
82+
:::
83+
84+
You can get more information about this method [here](/php-client/list-resources.html#by-getting-pages).
85+
86+
#### With a cursor
87+
88+
This method allows to iterate the family variants. It will automatically get the next pages for you.
89+
90+
```php
91+
$client = new \Akeneo\Pim\AkeneoPimClientBuilder('http://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
92+
93+
$familyVariants = $client->getFamilyVariantApi()->all('boots', 50);
94+
```
95+
96+
:::warning
97+
There is a maximum limit allowed on server side for the parameter `pageSize`.
98+
:::
99+
100+
You can get more information about this method [here](/php-client/list-resources.html#with-a-cursor).

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,45 @@ $client->getProductModelApi()->create('saddle_rain_boots', [
5959
```
6060

6161
Product model values use the same format as the product values. If you want to know more, take a look at [here](/documentation/resources.html#product-values).
62+
63+
### Get a list of product models
64+
65+
There are two ways of getting product models.
66+
67+
#### By getting pages
68+
69+
This method allows to get product models page per page, as a classical pagination.
70+
It's possible to get the total number of product models with this method.
71+
72+
```php
73+
$client = new \Akeneo\Pim\AkeneoPimClientBuilder('http://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
74+
75+
$firstPage = $client->getProductModelApi()->listPerPage(50, true);
76+
```
77+
78+
::: warning
79+
There is a maximum limit allowed on server side for the parameter `limit`.
80+
:::
81+
82+
::: warning
83+
Setting the parameter `with_count` to `true` can drastically decrease the performance.
84+
It's recommended to let this parameter with the default value `false` if the total number of product models is not needed in the response.
85+
:::
86+
87+
You can get more information about this method [here](/php-client/list-resources.html#by-getting-pages).
88+
89+
#### With a cursor
90+
91+
This method allows to iterate the product models. It will automatically get the next pages for you.
92+
93+
```php
94+
$client = new \Akeneo\Pim\AkeneoPimClientBuilder('http://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
95+
96+
$productModels = $client->getProductModelApi()->all(50);
97+
```
98+
99+
:::warning
100+
There is a maximum limit allowed on server side for the parameter `pageSize`.
101+
:::
102+
103+
You can get more information about this method [here](/php-client/list-resources.html#with-a-cursor).

0 commit comments

Comments
 (0)