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
added several api files in the same module to make it more readable
Use case
I have a module with several different types of routes created
Suggested implementation
I will be brief
Here are the ones that I added personally to search for the different files of but external module and to be able to create several different routes and several different api_XXX files in a single module
I wanted to know what when to think about community
Thank you
Sorry if my English is not very good
The text was updated successfully, but these errors were encountered:
i have a dream with PSR-4 for api routes at least for modules. PSR-4 will not imply "composer" but with PSR-4 we could adopt a more "classic way" of file naming convention and objects manipulation.
as @Monsieur76 try to explain, here is an example of a api_file.class.php made with module builder:
use Luracast\Restler\RestException;
/**
* \file indirectcustomers/class/api_indirectcustomers.class.php
* \ingroup indirectcustomers
* \brief File for API management of saleshistory.
*/
/**
* API class for indirectcustomers saleshistory
*
* @access protected
* @class DolibarrApiAccess {@requires user,external}
*/
class IndirectCustomersApi extends DolibarrApi
{
/**
* @var SalesHistory $saleshistory {@type SalesHistory}
*/
public $saleshistory;
/*begin methods CRUD*/
/*CRUD FOR SALESHISTORY*/
/**
* Get properties of a saleshistory object
*
* Return an array with saleshistory informations
*
* @param int $id ID of saleshistory
* @return Object Object with cleaned properties
*
* @url GET saleshistory/{id}
*
* @throws RestException 401 Not allowed
* @throws RestException 404 Not found
*/
public function get($id)
{
}
.../...
ok, that "get" function is entry point for ONE object from my module, but now how could we implement an OTHER get entry point for an OTHER object of the same module ?
Feature Request
added several api files in the same module to make it more readable
Use case
I have a module with several different types of routes created
Suggested implementation
I will be brief
Here are the ones that I added personally to search for the different files of but external module and to be able to create several different routes and several different api_XXX files in a single module
I wanted to know what when to think about community
Thank you
Sorry if my English is not very good
The text was updated successfully, but these errors were encountered: