|
| __construct () |
| Constructor.
|
|
| get ($id) |
| Get properties of a Expense Report object. More...
|
|
| index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $user_ids=0, $sqlfilters='') |
| List Expense Reports. More...
|
|
| post ($request_data=null) |
| Create Expense Report object. More...
|
|
| put ($id, $request_data=null) |
| Get lines of an Expense Report. More...
|
|
| delete ($id) |
| Delete Expense Report. More...
|
|
| __construct ($db, $cachedir='', $refreshCache=false) |
| Constructor. More...
|
|
◆ _cleanObjectDatas()
ExpenseReports::_cleanObjectDatas |
( |
|
$object | ) |
|
|
protected |
Validate an Expense Report.
- Parameters
-
@url POST {id}/validate
- Returns
- array FIXME An error 403 is returned if the request has an empty body. Error message: "Forbidden: Content type `text/plain` is not supported." Workaround: send this in the body { "idwarehouse": 0 } Clean sensible object datas
- Parameters
-
Object | $object | Object to clean |
- Returns
- Object Object with cleaned properties
Reimplemented from DolibarrApi.
Definition at line 517 of file api_expensereports.class.php.
◆ _validate()
ExpenseReports::_validate |
( |
|
$data | ) |
|
|
private |
◆ delete()
ExpenseReports::delete |
( |
|
$id | ) |
|
◆ get()
ExpenseReports::get |
( |
|
$id | ) |
|
Get properties of a Expense Report object.
Return an array with Expense Report informations
- Parameters
-
int | $id | ID of Expense Report |
- Returns
- Object Object with cleaned properties
- Exceptions
-
Definition at line 66 of file api_expensereports.class.php.
◆ index()
ExpenseReports::index |
( |
|
$sortfield = "t.rowid" , |
|
|
|
$sortorder = 'ASC' , |
|
|
|
$limit = 100 , |
|
|
|
$page = 0 , |
|
|
|
$user_ids = 0 , |
|
|
|
$sqlfilters = '' |
|
) |
| |
List Expense Reports.
Get a list of Expense Reports
- Parameters
-
string | $sortfield | Sort field |
string | $sortorder | Sort order |
int | $limit | Limit for list |
int | $page | Page number |
string | $user_ids | User ids filter field. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i} |
string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" |
- Returns
- array Array of Expense Report objects
Definition at line 98 of file api_expensereports.class.php.
◆ post()
ExpenseReports::post |
( |
|
$request_data = null | ) |
|
Create Expense Report object.
- Parameters
-
array | $request_data | Request data |
- Returns
- int ID of Expense Report
Definition at line 166 of file api_expensereports.class.php.
◆ put()
ExpenseReports::put |
( |
|
$id, |
|
|
|
$request_data = null |
|
) |
| |
Get lines of an Expense Report.
- Parameters
-
int | $id | Id of Expense Report |
@url GET {id}/lines
- Returns
- int Add a line to given Expense Report
- Parameters
-
int | $id | Id of Expense Report to update |
array | $request_data | Expense Report data |
@url POST {id}/lines
- Returns
- int Update a line to given Expense Report
- Parameters
-
int | $id | Id of Expense Report to update |
int | $lineid | Id of line to update |
array | $request_data | Expense Report data |
@url PUT {id}/lines/{lineid}
- Returns
- object Delete a line of given Expense Report
- Parameters
-
int | $id | Id of Expense Report to update |
int | $lineid | Id of line to delete |
@url DELETE {id}/lines/{lineid}
- Returns
- int Update Expense Report general fields (won't touch lines of expensereport)
- Parameters
-
int | $id | Id of Expense Report to update |
array | $request_data | Datas |
- Returns
- int
- Exceptions
-
RestException | 401 Not allowed |
RestException | 404 Expense report not found |
RestException | 500 System error |
Definition at line 405 of file api_expensereports.class.php.
The documentation for this class was generated from the following file: