|
dolibarr
13.0.2
|
Inheritance diagram for Contracts:
Collaboration diagram for Contracts:Public Member Functions | |
| __construct () | |
| Constructor. | |
| get ($id) | |
| Get properties of a contract object. More... | |
| index ($sortfield="t.rowid", $sortorder= 'ASC', $limit=100, $page=0, $thirdparty_ids= '', $sqlfilters= '') | |
| List contracts. More... | |
| post ($request_data=null) | |
| Create contract object. More... | |
| getLines ($id) | |
| Get lines of a contract. More... | |
| postLine ($id, $request_data=null) | |
| Add a line to given contract. More... | |
| putLine ($id, $lineid, $request_data=null) | |
| Update a line to given contract. More... | |
| activateLine ($id, $lineid, $datestart, $dateend=null, $comment=null) | |
| Activate a service line of a given contract. More... | |
| unactivateLine ($id, $lineid, $datestart, $comment=null) | |
| Unactivate a service line of a given contract. More... | |
| deleteLine ($id, $lineid) | |
| Delete a line to given contract. More... | |
| put ($id, $request_data=null) | |
| Update contract general fields (won't touch lines of contract) More... | |
| delete ($id) | |
| Delete contract. More... | |
| validate ($id, $notrigger=0) | |
| Validate a contract. More... | |
| close ($id, $notrigger=0) | |
| Close all services of a contract. 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 | |
| _cleanObjectDatas ($object) | |
| Executed method when API is called without parameter. More... | |
| _checkFilters ($sqlfilters) | |
| Return if a $sqlfilters parameter is valid. More... | |
Private Member Functions | |
| _validate ($data) | |
| Validate fields before create or update object. 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 user access to a resource. More... | |
| static | _forge_criteria_callback ($matches) |
| Function to forge a SQL criteria. More... | |
Definition at line 30 of file api_contracts.class.php.
|
protected |
Clean sensible object datas.
| Object | $object | Object to clean |
Definition at line 639 of file api_contracts.class.php.
Referenced by activateLine(), get(), getLines(), index(), putLine(), and unactivateLine().
|
private |
Validate fields before create or update object.
| array | $data | Array with data to verify |
| RestException |
Definition at line 666 of file api_contracts.class.php.
Referenced by post().
| Contracts::activateLine | ( | $id, | |
| $lineid, | |||
| $datestart, | |||
$dateend = null, |
|||
$comment = null |
|||
| ) |
Activate a service line of a given contract.
| int | $id | Id of contract to activate |
| int | $lineid | Id of line to activate |
| string | $datestart | { body} Date start { timestamp} |
| string | $dateend | { body} Date end { timestamp} |
| string | $comment | { body} Comment |
PUT {id}/lines/{lineid}/activate
Definition at line 366 of file api_contracts.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Contracts::close | ( | $id, | |
$notrigger = 0 |
|||
| ) |
Close all services of a contract.
| int | $id | Contract ID |
| int | $notrigger | 1=Does not execute triggers, 0= execute triggers |
POST {id}/close
Definition at line 600 of file api_contracts.class.php.
References DolibarrApi\_checkAccessToResource().
| Contracts::delete | ( | $id | ) |
Delete contract.
| int | $id | Contract ID |
Definition at line 512 of file api_contracts.class.php.
References DolibarrApi\_checkAccessToResource().
| Contracts::deleteLine | ( | $id, | |
| $lineid | |||
| ) |
Delete a line to given contract.
| int | $id | Id of contract to update |
| int | $lineid | Id of line to delete |
DELETE {id}/lines/{lineid}
| RestException | 401 |
| RestException | 404 |
Definition at line 446 of file api_contracts.class.php.
References DolibarrApi\_checkAccessToResource().
| Contracts::get | ( | $id | ) |
Get properties of a contract object.
Return an array with contract informations
| int | $id | ID of contract |
| RestException |
Definition at line 68 of file api_contracts.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Contracts::getLines | ( | $id | ) |
Get lines of a contract.
| int | $id | Id of contract |
GET {id}/lines
Definition at line 221 of file api_contracts.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Contracts::index | ( | $sortfield = "t.rowid", |
|
$sortorder = 'ASC', |
|||
$limit = 100, |
|||
$page = 0, |
|||
$thirdparty_ids = '', |
|||
$sqlfilters = '' |
|||
| ) |
List contracts.
Get a list of contracts
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | Limit for list |
| int | $page | Page number |
| string | $thirdparty_ids | Thirdparty ids to filter contracts of (example '1' or '1,2,3') { /^[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')" |
| RestException | 404 Not found |
| RestException | 503 Error |
Definition at line 105 of file api_contracts.class.php.
References DolibarrApi\_checkFilters(), _cleanObjectDatas(), db, and dol_syslog().
| Contracts::post | ( | $request_data = null | ) |
Create contract object.
| array | $request_data | Request data |
Definition at line 187 of file api_contracts.class.php.
References _validate().
| Contracts::postLine | ( | $id, | |
$request_data = null |
|||
| ) |
Add a line to given contract.
| int | $id | Id of contrat to update |
| array | $request_data | Contractline data |
POST {id}/lines
Definition at line 253 of file api_contracts.class.php.
References DolibarrApi\_checkAccessToResource().
| Contracts::put | ( | $id, | |
$request_data = null |
|||
| ) |
Update contract general fields (won't touch lines of contract)
| int | $id | Id of contract to update |
| array | $request_data | Datas |
Definition at line 479 of file api_contracts.class.php.
References DolibarrApi\_checkAccessToResource().
| Contracts::putLine | ( | $id, | |
| $lineid, | |||
$request_data = null |
|||
| ) |
Update a line to given contract.
| int | $id | Id of contrat to update |
| int | $lineid | Id of line to update |
| array | $request_data | Contractline data |
PUT {id}/lines/{lineid}
Definition at line 306 of file api_contracts.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Contracts::unactivateLine | ( | $id, | |
| $lineid, | |||
| $datestart, | |||
$comment = null |
|||
| ) |
Unactivate a service line of a given contract.
| int | $id | Id of contract to activate |
| int | $lineid | Id of line to activate |
| string | $datestart | { body} Date start { timestamp} |
| string | $comment | { body} Comment |
PUT {id}/lines/{lineid}/unactivate
Definition at line 404 of file api_contracts.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Contracts::validate | ( | $id, | |
$notrigger = 0 |
|||
| ) |
Validate a contract.
| int | $id | Contract ID |
| int | $notrigger | 1=Does not execute triggers, 0= execute triggers |
POST {id}/validate
Definition at line 554 of file api_contracts.class.php.
References DolibarrApi\_checkAccessToResource().