You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/php-client/resources/family-variants.md
+61Lines changed: 61 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,3 +98,64 @@ There is a maximum limit allowed on server side for the parameter `pageSize`.
98
98
:::
99
99
100
100
You can get more information about this method [here](/php-client/list-resources.html#with-a-cursor).
101
+
102
+
### Upsert a family variant
103
+
104
+
If the family variant does not exist yet, this method creates it, otherwise it updates it.
105
+
106
+
```php
107
+
$client = new \Akeneo\Pim\AkeneoPimClientBuilder('http://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
108
+
109
+
$client->getFamilyVariantApi()->upsert('boots', [
110
+
'code' => 'rain_boots_color_size',
111
+
'labels' => [
112
+
'de_DE' => 'Stiefel nach Farbe und Größe',
113
+
'en_US' => 'Updating label',
114
+
'fr_FR' => 'Mise à jour du label'
115
+
]
116
+
]);
117
+
```
118
+
119
+
### Upsert a list of family variants
120
+
121
+
This method allows to create or update a list of family variants.
122
+
It has the same behavior as the `upsert` method for a single family variant, except that the code must be specified in the data of each family variant.
123
+
124
+
125
+
```php
126
+
$client = new \Akeneo\Pim\AkeneoPimClientBuilder('http://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
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
104
63
-
### Get a list of product models
64
-
65
-
There are two ways of getting product models.
66
-
67
-
#### By getting pages
105
+
### Upsert a product model
68
106
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.
107
+
If the product model does not exist yet, this method creates it, otherwise it updates it.
71
108
72
109
```php
73
110
$client = new \Akeneo\Pim\AkeneoPimClientBuilder('http://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin');
0 commit comments