dolibarr  7.0.0-beta
Public Member Functions | List of all members
ExpenseReports Class Reference
+ Inheritance diagram for ExpenseReports:
+ Collaboration diagram for ExpenseReports:

Public Member Functions

 __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...
 
 _cleanObjectDatas ($object)
 Validate an Expense Report. More...
 
 _validate ($data)
 Validate fields before create or update object. More...
 
- Public Member Functions inherited from DolibarrApi
 __construct ($db, $cachedir='', $refreshCache=false)
 Constructor. More...
 
 _cleanObjectDatas ($object)
 Executed method when API is called without parameter. More...
 
 _checkFilters ($sqlfilters)
 Return if a $sqlfilters parameter is valid. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from DolibarrApi
static _checkAccessToResource ($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid')
 Check user access to a resource. More...
 
static _forge_criteria_callback ($matches)
 Function to forge a SQL criteria. More...
 

Detailed Description

Definition at line 29 of file api_expensereports.class.php.

Member Function Documentation

ExpenseReports::_cleanObjectDatas (   $object)

Validate an Expense Report.

Parameters
int$idExpense Report ID

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$objectObject to clean
Returns
array Array of cleaned object properties

Definition at line 493 of file api_expensereports.class.php.

Referenced by get(), and index().

ExpenseReports::_validate (   $data)

Validate fields before create or update object.

Parameters
array$dataArray with data to verify
Returns
array
Exceptions
RestException

Definition at line 512 of file api_expensereports.class.php.

Referenced by post().

ExpenseReports::delete (   $id)

Delete Expense Report.

Parameters
int$idExpense Report ID
Returns
array

Definition at line 418 of file api_expensereports.class.php.

References DolibarrApi\_checkAccessToResource().

ExpenseReports::get (   $id)

Get properties of a Expense Report object.

Return an array with Expense Report informations

Parameters
int$idID of Expense Report
Returns
array|mixed Data without useless information
Exceptions
RestException

Definition at line 65 of file api_expensereports.class.php.

References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().

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$sortfieldSort field
string$sortorderSort order
int$limitLimit for list
int$pagePage number
string$user_idsUser ids filter field. Example: '1' or '1,2,3' { /^[0-9,]*$/i}
string$sqlfiltersOther 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 97 of file api_expensereports.class.php.

References DolibarrApi\_checkFilters(), and _cleanObjectDatas().

ExpenseReports::post (   $request_data = NULL)

Create Expense Report object.

Parameters
array$request_dataRequest data
Returns
int ID of Expense Report

Definition at line 163 of file api_expensereports.class.php.

References _validate().

ExpenseReports::put (   $id,
  $request_data = NULL 
)

Get lines of an Expense Report.

Parameters
int$idId of Expense Report

GET {id}/lines

Returns
int Add a line to given Expense Report
Parameters
int$idId of Expense Report to update
array$request_dataExpense Report data

POST {id}/lines

Returns
int Update a line to given Expense Report
Parameters
int$idId of Expense Report to update
int$lineidId of line to update
array$request_dataExpense Report data

PUT {id}/lines/{lineid}

Returns
object Delete a line of given Expense Report
Parameters
int$idId of Expense Report to update
int$lineidId of line to delete

DELETE {id}/lines/{lineid}

Returns
int Update Expense Report general fields (won't touch lines of expensereport)
Parameters
int$idId of Expense Report to update
array$request_dataDatas
Returns
int

Definition at line 383 of file api_expensereports.class.php.

References DolibarrApi\_checkAccessToResource().


The documentation for this class was generated from the following file: