Added since tags to orders api PHPDoc (#36919)

This commit is contained in:
William Mead
2026-01-19 19:10:44 +01:00
committed by GitHub
parent eeaa02390e
commit 566aec36c6

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025 William Mead <william@m34d.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,6 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
/**
* API class for orders
*
* @since 4.0.0 Initial implementation
* @access protected
* @class DolibarrApiAccess {@requires user,external}
*/
@@ -59,6 +61,7 @@ class Orders extends DolibarrApi
*
* Return an array with order information
*
* @since 4.0.0 Initial implementation
* @param int $id ID of order
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id, -1: Do not return contacts/adddesses
* @return array|mixed data without useless information
@@ -75,6 +78,7 @@ class Orders extends DolibarrApi
*
* Return an array with order information
*
* @since 10.0.0 Initial implementation
* @param string $ref Ref of object
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id, -1: Do not return contacts/adddesses
* @return array|mixed data without useless information
@@ -93,6 +97,7 @@ class Orders extends DolibarrApi
*
* Return an array with order information
*
* @since 10.0.0 Initial implementation
* @param string $ref_ext External reference of object
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id, -1: Do not return contacts/adddesses
* @return array|mixed data without useless information
@@ -162,6 +167,8 @@ class Orders extends DolibarrApi
*
* Get a list of orders
*
* @since 4.0.0 Initial implementation
* @since 20.0.0 Return pagination data
* @param string $sortfield Sort field
* @param string $sortorder Sort order
* @param int $limit Limit for list
@@ -308,6 +315,7 @@ class Orders extends DolibarrApi
*
* Example: { "socid": 2, "date": 1595196000, "type": 0, "lines": [{ "fk_product": 2, "qty": 1 }] }
*
* @since 4.0.0 Initial implementation
* @param array $request_data Request data
* @phan-param ?array<string,string> $request_data
* @phpstan-param ?array<string,string> $request_data
@@ -355,6 +363,7 @@ class Orders extends DolibarrApi
/**
* Get lines of an order
*
* @since 4.0.0 Initial implementation
* @param int $id Id of order
*
* @url GET {id}/lines
@@ -388,6 +397,7 @@ class Orders extends DolibarrApi
/**
* Get properties of a line of an order object by id
*
* @since 19.0.0 Initial implementation
* @param int $id Id of order
* @param int $lineid Id of line
* @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names
@@ -423,6 +433,7 @@ class Orders extends DolibarrApi
/**
* Add a line to given order
*
* @since 4.0.0 Initial implementation
* @param int $id Id of order to update
* @param array $request_data OrderLine data
* @phan-param ?array<string,string> $request_data
@@ -492,6 +503,7 @@ class Orders extends DolibarrApi
/**
* Update a line to given order
*
* @since 4.0.0 Initial implementation
* @param int $id Id of order to update
* @param int $lineid Id of line to update
* @param array $request_data OrderLine data
@@ -560,6 +572,7 @@ class Orders extends DolibarrApi
/**
* Delete a line of a given order
*
* @since 4.0.0 Initial implementation
* @param int $id Id of order to update
* @param int $lineid Id of line to delete
* @return Object Object with cleaned properties
@@ -597,6 +610,7 @@ class Orders extends DolibarrApi
*
* Return an array with contact information
*
* @since 12.0.0 Initial implementation
* @param int $id ID of order
* @param string $type Type of the contact ('BILLING', 'SHIPPING', 'CUSTOMER', ...)
* @return array<int,mixed> Array of contacts
@@ -631,6 +645,7 @@ class Orders extends DolibarrApi
/**
* Add a contact type of given order
*
* @since 10.0.0 Initial implementation
* @param int $id Id of order to update
* @param int $contactid Id of contact to add
* @param string $type Type (code in dictionary) of the contact (BILLING, SHIPPING, CUSTOMER + possibly your own)
@@ -754,6 +769,7 @@ class Orders extends DolibarrApi
/**
* Unlink a contact type of given order
*
* @since 12.0.0 Initial implementation
* @param int $id Id of order to update
* @param int $contactid Id of contact
* @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER).
@@ -807,6 +823,7 @@ class Orders extends DolibarrApi
/**
* Update order general fields (won't touch lines of order)
*
* @since 4.0.0 Initial implementation
* @param int $id Id of order to update
* @param array $request_data Data
* @phan-param ?array<string,string> $request_data
@@ -865,6 +882,7 @@ class Orders extends DolibarrApi
/**
* Delete order
*
* @since 4.0.0 Initial implementation
* @param int $id Order ID
* @return array
* @phan-return array{success:array{code:int,message:string}}
@@ -908,6 +926,7 @@ class Orders extends DolibarrApi
* "notrigger": 0
* }
*
* @since 4.0.0 Initial implementation
* @param int $id Order ID
* @param int $idwarehouse Warehouse ID
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
@@ -959,6 +978,7 @@ class Orders extends DolibarrApi
*
* Function used when order is reopend after being closed.
*
* @since 4.0.0 Initial implementation
* @param int $id Id of the order
*
* @url POST {id}/reopen
@@ -997,6 +1017,7 @@ class Orders extends DolibarrApi
/**
* Classify the order as invoiced. Could be also called setbilled
*
* @since 4.0.0 Initial implementation
* @param int $id Id of the order
* @return Object Object with cleaned properties
*
@@ -1042,6 +1063,7 @@ class Orders extends DolibarrApi
/**
* Close an order (Classify it as "Delivered")
*
* @since 4.0.0 Initial implementation
* @param int $id Order ID
* @param int $notrigger Disabled triggers
* @return Object Object with cleaned properties
@@ -1088,6 +1110,7 @@ class Orders extends DolibarrApi
/**
* Set an order to draft
*
* @since 4.0.0 Initial implementation
* @param int $id Order ID
* @param int $idwarehouse Warehouse ID to use for stock change (Used only if option STOCK_CALCULATE_ON_VALIDATE_ORDER is on)
* @return Object Object with cleaned properties
@@ -1135,6 +1158,7 @@ class Orders extends DolibarrApi
/**
* Create an order using an existing proposal.
*
* @since 4.0.0 Initial implementation
* @param int $proposalid Id of the proposal
* @return Object Object with cleaned properties
*
@@ -1177,6 +1201,7 @@ class Orders extends DolibarrApi
/**
* Get the shipments of an order
*
* @since 14.0.0 Initial implementation
* @param int $id Id of the order
*
* @url GET {id}/shipment
@@ -1236,6 +1261,7 @@ class Orders extends DolibarrApi
/**
* Create the shipment of an order
*
* @since 14.0.0 Initial implementation
* @param int $id Id of the order
* @param int $warehouse_id Id of a warehouse
*