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

Public Member Functions

 __construct ()
 Constructor.
 
 index ($sortfield="t.rowid", $sortorder= 'ASC', $limit=100, $page=0, $sqlfilters= '')
 Get properties of a stock movement object. More...
 
 post ($request_data=NULL)
 Create stock movement object. More...
 
 _cleanObjectDatas ($object)
 Update stock movement. 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_stockmovements.class.php.

Member Function Documentation

StockMovements::_cleanObjectDatas (   $object)

Update stock movement.

Parameters
int$idId of warehouse to update
array$request_dataDatas
Returns
int Delete stock movement
Parameters
int$idStock movement ID
Returns
array Clean sensible object datas
Parameters
MouvementStock$objectObject to clean
Returns
array Array of cleaned object properties

Definition at line 282 of file api_stockmovements.class.php.

Referenced by index().

StockMovements::_validate (   $data)

Validate fields before create or update object.

Parameters
array | null$dataData to validate
Returns
array
Exceptions
RestException

Definition at line 339 of file api_stockmovements.class.php.

StockMovements::index (   $sortfield = "t.rowid",
  $sortorder = 'ASC',
  $limit = 100,
  $page = 0,
  $sqlfilters = '' 
)

Get properties of a stock movement object.

Return an array with stock movement informations

Parameters
int$idID of movement
Returns
array|mixed data without useless information
Exceptions
RestExceptionGet a list of stock movement
Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitLimit for list
int$pagePage number
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.product_id:=:1) and (t.date_creation:<:'20160101')"
Returns
array Array of warehouse objects
Exceptions
RestException

Definition at line 96 of file api_stockmovements.class.php.

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

StockMovements::post (   $request_data = NULL)

Create stock movement object.

You can use the following message to test this RES API: { "product_id": 1, "warehouse_id": 1, "qty": 1, "lot": "", "movementcode": "INV123", "movementlabel": "Inventory 123", "price": 0 }

Parameters
array$request_dataRequest data
Returns
int ID of stock movement

Definition at line 176 of file api_stockmovements.class.php.


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