dolibarr  17.0.4
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
Mos Class Reference
Inheritance diagram for Mos:
Inheritance graph
[legend]
Collaboration diagram for Mos:
Collaboration graph
[legend]

Public Member Functions

 __construct ()
 Constructor.
 
 get ($id)
 Get properties of a MO object. More...
 
 index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $sqlfilters='')
 List Mos. More...
 
 post ($request_data=null)
 Create MO object. More...
 
 put ($id, $request_data=null)
 Update MO. More...
 
 delete ($id)
 Delete MO. More...
 
 produceAndConsume ($id, $request_data=null)
 Produce and consume. More...
 
- Public Member Functions inherited from DolibarrApi
 __construct ($db, $cachedir='', $refreshCache=false)
 Constructor. More...
 

Protected Member Functions

 _cleanObjectDatas ($object)
 Clean sensible object datas. More...
 
- Protected Member Functions inherited from DolibarrApi
 _checkValForAPI ($field, $value, $object)
 Check and convert a string depending on its type/name. More...
 
 _checkFilters ($sqlfilters, &$error='')
 Return if a $sqlfilters parameter is valid Function no more used. More...
 

Private Member Functions

 _validate ($data)
 Validate fields before create or update object. More...
 
 checkRefNumbering ()
 Validate the ref field and get the next Number if it's necessary. More...
 

Additional Inherited Members

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

Detailed Description

Definition at line 36 of file api_mos.class.php.

Member Function Documentation

◆ _cleanObjectDatas()

Mos::_cleanObjectDatas (   $object)
protected

Clean sensible object datas.

Parameters
Object$objectObject to clean
Returns
Object Object with cleaned properties

Reimplemented from DolibarrApi.

Definition at line 653 of file api_mos.class.php.

◆ _validate()

Mos::_validate (   $data)
private

Validate fields before create or update object.

Parameters
array$dataArray of data to validate
Returns
array
Exceptions
RestException

Definition at line 716 of file api_mos.class.php.

◆ checkRefNumbering()

Mos::checkRefNumbering ( )
private

Validate the ref field and get the next Number if it's necessary.

Returns
void

Definition at line 736 of file api_mos.class.php.

◆ delete()

Mos::delete (   $id)

Delete MO.

Parameters
int$idMO ID
Returns
array

Definition at line 259 of file api_mos.class.php.

◆ get()

Mos::get (   $id)

Get properties of a MO object.

Return an array with MO informations

Parameters
int$idID of MO
Returns
array|mixed data without useless information

@url GET {id}

Exceptions
RestException

Definition at line 64 of file api_mos.class.php.

◆ index()

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

List Mos.

Get a list of MOs

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.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
Returns
array Array of order objects
Exceptions
RestException

Definition at line 97 of file api_mos.class.php.

◆ post()

Mos::post (   $request_data = null)

Create MO object.

Parameters
array$request_dataRequest datas
Returns
int ID of MO

Definition at line 194 of file api_mos.class.php.

◆ produceAndConsume()

Mos::produceAndConsume (   $id,
  $request_data = null 
)

Produce and consume.

Example: { "inventorylabel": "Produce and consume using API", "inventorycode": "PRODUCEAPI-YY-MM-DD", "autoclose": 1, "arraytoconsume": [], "arraytoproduce": [] }

Parameters
int$idID of state
array$request_dataRequest datas

@url POST {id}/produceandconsume

Returns
int ID of MO

Definition at line 305 of file api_mos.class.php.

◆ put()

Mos::put (   $id,
  $request_data = null 
)

Update MO.

Parameters
int$idId of MO to update
array$request_dataDatas
Returns
int

Definition at line 222 of file api_mos.class.php.


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