Skip to content

Commit 48defa3

Browse files
W1W1-Meldy
andauthored
Updated PHPDoc (#36191)
Co-authored-by: Laurent Destailleur <[email protected]>
1 parent 8c98307 commit 48defa3

File tree

2 files changed

+36
-18
lines changed

2 files changed

+36
-18
lines changed

htdocs/product/stock/class/api_stockmovements.class.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
/**
2626
* API class for stock movements
2727
*
28+
* @since 5.0.0 Initial implementation
29+
*
2830
* @access protected
2931
* @class DolibarrApiAccess {@requires user,external}
3032
*/
@@ -59,6 +61,8 @@ public function __construct()
5961
*
6062
* Return an array with stock movement information
6163
*
64+
* @since 5.0.0 Initial implementation
65+
*
6266
* @param int $id ID of movement
6367
* @return Object Object with cleaned properties
6468
*
@@ -84,7 +88,9 @@ public function get($id)
8488
}*/
8589

8690
/**
87-
* Get a list of stock movement
91+
* Get a list of stock movements
92+
*
93+
* @since 5.0.0 Initial implementation
8894
*
8995
* @param string $sortfield Sort field
9096
* @param string $sortorder Sort order
@@ -181,6 +187,8 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
181187
* $eatBy Eat-by date. Will be used if a batch does not exist yet and will be created.
182188
* sellBy Sell-by date. Will be used if a batch does not exist yet and will be created.
183189
*
190+
* @since 5.0.0 Initial implementation
191+
*
184192
* @param int $product_id ID product id {@min 1} {@from body} {@required true}
185193
* @param int $warehouse_id ID warehouse {@min 1} {@from body} {@required true}
186194
* @param float $qty Qty to add (Use negative value for a stock decrease) {@from body} {@required true}

htdocs/product/stock/class/api_warehouses.class.php

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
/**
2626
* API class for warehouses
2727
*
28+
* @since 5.0.0 Initial implementation
29+
*
2830
* @access protected
2931
* @class DolibarrApiAccess {@requires user,external}
3032
*/
@@ -57,8 +59,10 @@ public function __construct()
5759
*
5860
* Return an array with warehouse information
5961
*
62+
* @since 5.0.0 Initial implementation
63+
*
6064
* @param int $id ID of warehouse
61-
* @return Object Object with cleaned properties
65+
* @return Object Object with cleaned properties
6266
*
6367
* @url GET {id}
6468
*
@@ -192,7 +196,9 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
192196

193197

194198
/**
195-
* Create warehouse object
199+
* Create a warehouse
200+
*
201+
* @since 5.0.0 Initial implementation
196202
*
197203
* @param array $request_data Request data
198204
* @phan-param ?array<string,string> $request_data
@@ -238,13 +244,15 @@ public function post($request_data = null)
238244
}
239245

240246
/**
241-
* Update warehouse
247+
* Update a warehouse
242248
*
243-
* @param int $id Id of warehouse to update
244-
* @param array $request_data Data
249+
* @since 5.0.0 Initial implementation
250+
*
251+
* @param int $id ID of warehouse to update
252+
* @param array $request_data Data
245253
* @phan-param ?array<string,string> $request_data
246254
* @phpstan-param ?array<string,string> $request_data
247-
* @return Object Updated object
255+
* @return Object Updated object
248256
*
249257
* @url PUT {id}
250258
*
@@ -307,10 +315,12 @@ public function put($id, $request_data = null)
307315
}
308316

309317
/**
310-
* Delete warehouse
318+
* Delete a warehouse
319+
*
320+
* @since 5.0.0 Initial implementation
311321
*
312-
* @param int $id Warehouse ID
313-
* @return array
322+
* @param int $id Warehouse ID
323+
* @return array
314324
* @phan-return array{success:array{code:int,message:string}}
315325
* @phpstan-return array{success:array{code:int,message:string}}
316326
*
@@ -352,24 +362,24 @@ public function delete($id)
352362
}
353363

354364
/**
355-
* List Product in warehouses
365+
* List products in a warehouse
356366
*
357-
* Get a list of product in a warehouse
367+
* Get a list of products for a warehouse
358368
*
359369
* @since 23.0.0 Initial implementation
360370
*
361-
* @param int $id warehouse ID
371+
* @param int $id warehouse ID {@min 1} {@from body} {@required true}
362372
* @param string $sortfield Sort field
363373
* @param string $sortorder Sort order
364-
* @param int $limit Limit for list
374+
* @param int $limit Limit for list
365375
* @param int $page Page number
366376
* @param int $includestockdata 1=Load also information about stock (slower), 0=No stock data (faster) (default)
367-
* @param bool $includesubproducts Load information about subproducts
368-
* @param bool $includeparentid Load also ID of parent product (if product is a variant of a parent product)
377+
* @param bool $includesubproducts Load information about subproducts
378+
* @param bool $includeparentid Load also ID of parent product (if product is a variant of a parent product)
369379
* @param bool $includetrans Load also the translations of product label and description
370-
* @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names
380+
* @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names
371381
* @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0
372-
* @return array Array of product in warehouse
382+
* @return array Array of product in warehouse
373383
*
374384
* @phan-return Product[]
375385
* @phpstan-return Product[]

0 commit comments

Comments
 (0)